models.SlugField doesn't validate against slug_re
This appears to be a bug to me:
from django.db import models
class MyModel(models.Model):
slug = models.SlugField()
mymodel = MyModel(slug='this is an invalid % $ ## slug')
mymodel.full_clean() # it'd expect this to raise a validation error... it does not.
Change History
(4)
Easy pickings: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Uncategorized → Bug
|
Cc: |
bmispelon@… added
|
Owner: |
changed from nobody to Baptiste Mispelon
|
Status: |
new → assigned
|
Has patch: |
set
|
Owner: |
Baptiste Mispelon removed
|
Status: |
assigned → new
|
Owner: |
set to Tim Graham <timograham@…>
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
PR here: https://github.com/django/django/pull/1267
I also included some cleanup of the
URLField
validators.Since 9ed6e08ff99c18710c0e4875f827235f04c89d76, the
URLField
(both model and form field) validator doesn't depend on a parameter passed in__init__
so it can be added directly toURLField.default_validators
.