#23985 closed Cleanup/optimization (fixed)
URLValidator optional schemes causes backward incompatible changes
Description ¶
For people who were using custom regex to restrict uri schemes this new optional feature causes a backwards incompatible change, because any scheme not listed in schemes param will not be validated, even if the regex matches the given url.
It would be nice to have a note in the backward incompatible changes documentation of Django 1.7.
Change History (8)
comment:1 by , 10 years ago
Component: | Uncategorized → Core (Other) |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 10 years ago
Component: | Core (Other) → Documentation |
---|
comment:4 by , 9 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
Hi,
I'm not sure what the benefit of using a
URLValidator
over a plainRegexvalidator
is if you're using a customregex
but still, I think you're right.The following (simplified) code would pass under Django 1.6 but raises a
ValidationError
under 1.7:I wonder if there's a way to fix the backwards-compatibility issue rather than documenting it (maybe by disabling
schemes
if a customregex
has been given but that might not be feasible in practice).If we can't fix the issue, then we should certainly document it.
Thanks.