#27947: error_messages does not work on SlugField in ModelForm
----------------------------------------------+------------------------
               Reporter:  Jimmy Merrild Krag  |          Owner:  nobody
                   Type:  Bug                 |         Status:  new
              Component:  Uncategorized       |        Version:  1.8
               Severity:  Normal              |       Keywords:
           Triage Stage:  Unreviewed          |      Has patch:  0
    Needs documentation:  0                   |    Needs tests:  0
Patch needs improvement:  0                   |  Easy pickings:  0
                  UI/UX:  0                   |
----------------------------------------------+------------------------
 I have the following field in a model:


 {{{
     reference = models.SlugField(
         max_length=20,
         blank=False, null=False,
         error_messages={
             'invalid': _('A reference may only contain letters, numbers,
 underscores and hyphens.'),
         })
 }}}


 however, when submitting the field in a `ModelForm` with invalid content
 (e.g. containing a space character) the error message is the default one
 for `SlugField` and not the one I set.

--
Ticket URL: <https://code.djangoproject.com/ticket/27947>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.b1c142eb6401ffa18052d692d3f2f786%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to