-
Notifications
You must be signed in to change notification settings - Fork 32
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
Reverse and resolve issues using includes with namespaces in flagged_path() #100
Comments
@mkeener Hmm, your assumptions about |
@mkeener I believe I've found the problem — and it's a pretty simple one: We have a The problem is when creating the new pattern for an include, we set Django's So... the fix here is for us to set This is a long way to saying... it's a simple, one-line change, and I'll have a PR to fix it momentarily. |
This change fixes an issue with `flagged_path` where `includes()` would not be correctly included, and cannot be resolved using their names. The issue was simply with our passing of `is_endpoint` to the pattern class. In the case of `path()` URLs, the pattern class is `RoutePattern`, and it doesn’t double-check `is_endpoint` the way `RegexPattern` does. I have some more details in #100. This is a simple fix to change that incorrect `True` to `False`.
This is great, thanks for the explanation! I was really wondering where the extra |
Django version: 2.2
Django-flags version: 5.0.9
We have a mutli-module django application with several of the modules gated behind feature flags. In our deployment
urls.py
we use a combination of standardpath()
definitions with separate flagged_paths. Our flagged paths look like:The contents of the module urls file looks something like:
When verifying the view name with
reverse()
we get an error that there is no reverse match like this:I'm trying to figure out why there is an additional
$
in the pattern, and if that has anything to do with why the paths fail to match. We're not using any regex path matching via re_path or old url(r'^module-name/$') style path matching.If I switch from using
flagged_path()
toflagged_re_path
it appears to resolve correctly. Is there something I'm misunderstanding about the usage offlagged_path()
? All the instances I've usedflagged_path()
have been drop-in replacements forpath()
usage. Any direction would be appreciated!The text was updated successfully, but these errors were encountered: