#32897: create_user() does not raise ValidationError
------------------------------+--------------------------------------
     Reporter:  Adam McKay    |                    Owner:  nobody
         Type:  Bug           |                   Status:  closed
    Component:  contrib.auth  |                  Version:  3.2
     Severity:  Normal        |               Resolution:  invalid
     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 Adam McKay):

 Replying to [comment:1 Tim Graham]:
 > The lack of validation is consistent with `Model.save()`, etc. I see
 nothing in the documentation that suggests this would behave otherwise.

 Hi Tim,

 I agree the behaviour is consistent with `Model.save()`, however I think
 the usage of `create_user` goes beyond a typical model method as it will
 ensure a `username` is specified (raises an exception if not), normalises
 `username` and `email` and can also generate a `password` if one is not
 specified.

 Perhaps I should have logged this as a feature enhancement to call
 `full_clean()` prior to `user.save()` rather than a bug? My intention
 being to get a more accurate error from the method.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32897#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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.d862b8e42da4e9428c125fd8bdc337ca%40djangoproject.com.

Reply via email to