-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify the testing matrix and add isort #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few minor comments.
|
||
To use Wagtail-Flags you first need to define the flag, use the flag in code, and define conditions for the flag to be enabled. | ||
To use Wagtail-Flags you first need to define the flag, use the flag, and define conditions for the flag to be enabled. | ||
|
||
First, define the flag in Django `settings.py`: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't changed in this PR, but as part of reviewing this I noticed a missing )
at the end of line 94. Instead of
url(r'^/mypage$', TemplateView.as_view(template_name='mytemplate.html'),
it should be
url(r'^/mypage$', TemplateView.as_view(template_name='mytemplate.html')),
README.md
Outdated
from flags.state import flag_enabled | ||
|
||
if flag_enabled('MY_FLAG', request=a_request): | ||
print("My feature flag is enabled") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentionally indented 8 spaces instead of 4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope!
README.md
Outdated
Django templates: | ||
|
||
```django | ||
{% flag_enabled 'MY_FLAG' as my_flag %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to include the
{% load feature_flags %}
line here (as above in Quickstart) as this is necessary for this tag to work.
README.md
Outdated
Jinja2 templates: | ||
|
||
```jinja | ||
{% if flag_enabled('MY_FLAG', request) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work in Jinja if you don't explicitly include this in the global environment, i.e. an entry here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! I'll add that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
One nit, not related to this PR: The cfgov-refresh link at the very bottom of the README throws a 404.
b1bd0e4
to
af8c07e
Compare
af8c07e
to
ee2419b
Compare
@higs4281 fixed that too! |
This PR does the following: