URLValidator optional schemes causes backward incompatible changes
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)
Component: |
Uncategorized → Core (Other)
|
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Uncategorized → Cleanup/optimization
|
Component: |
Core (Other) → Documentation
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
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.