#20846: Increase contrib.auth's User.username length
------------------------------+--------------------------------------
     Reporter:  ivoras@…      |                    Owner:  nobody
         Type:  New feature   |                   Status:  new
    Component:  contrib.auth  |                  Version:  1.5
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  1             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  1             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by carljm):

 Replying to [comment:10 hwkns]:
 > Apologies for re-opening if that was not the correct course of action.
 I just got burned by this issue, after migrating a very large Django
 project, from 1.6 using the third-party `longerusername` package, to 1.7
 (for which that package does not yet have a migration).  This is our only
 blocker for deploying with 1.7, and it's painful that my choices are to
 either create a custom User model or fork a third-party library.

 Or contribute a fix to the third-party library, which shouldn't take them
 long to accept if it's maintained (and if it's not maintained, you may be
 better off moving that monkeypatch into your own code base anyway).

 > Replying to [comment:9 carljm]:
 > > If they never run `migrate`, that results in a much much worse
 situation, because their models no longer match their database schema,
 meaning that instead of getting nice Django-level form validation errors,
 they now get unpredictable errors depending on their database backend --
 some backends will silently truncate the data, some will raise a database-
 error resulting in a 500 Internal Server Error.
 > `max_length` can and should be specified in forms for validation.  It
 was my impression that the model's `max_length` information was only for
 the database backend...  is that inaccurate?

 If you use a `ModelForm` without overriding the field, the form field's
 `max_length` will be automatically derived from the model field's
 `max_length`.

--
Ticket URL: <https://code.djangoproject.com/ticket/20846#comment:11>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.509b7751eeabeb44ddd0be2d4cf3ab57%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to