cfpb / django-flags

Feature flags for Django projects
https://cfpb.github.io/django-flags/
Creative Commons Zero v1.0 Universal
256 stars 31 forks source link

Fix an issue with `flagged_path` and includes #101

Closed willbarton closed 2 years ago

willbarton commented 2 years ago

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 closes #100.

willbarton commented 2 years ago

@mkeener would you be able to test if this fixes your issue?

mkeener commented 2 years ago

@willbarton I changed this line in my local and it works as expected, thanks!

willbarton commented 2 years ago

Because this is a single line change to bring our code in line with what Django already implements, and because this strikes me as a fairly major bug, I'm going to go ahead and merge this PR.