#27238: Removal of check_pattern_startswith_slash -------------------------------------+------------------------------------- Reporter: strycore | Owner: nobody Type: | Status: new Cleanup/optimization | Component: Core (System | Version: 1.10 checks) | Severity: Normal | Resolution: Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by alasdairnicol): We could change the `check_resolver` method so that it passes the regex when called recursively. * If we call `check_resolver(resolver, r'^dashboard')` then we shouldn't run `check_pattern_startswith_slash`. This would prevent the false positives for strycore's example. * If we call `check_resolver(resolver, r'^dashboard/')` or `check_resolver(resolver, None)` (initial call) then it is ok to run `check_pattern_startswith_slash`. I haven't tried writing a patch for this yet. Modifying the check_resolver method like this might be overly complex. I like the simplicity of checking `settings.APPEND_SLASH` as Tim suggested. -- Ticket URL: <https://code.djangoproject.com/ticket/27238#comment:2> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.748f369b8fa0851e151f78fbd1d2f108%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.