[GH-ISSUE #113] Django username is limited to 30 characters #97

Closed
opened 2026-02-27 11:10:04 +03:00 by kerem · 5 comments
Owner

Originally created by @tonioo on GitHub (Dec 4, 2013).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/113

Originally assigned to: @tonioo on GitHub.

Originally created by Pedro Gracia on 2010-11-30T12:24:27Z

I find a severe limitation related to username due to django. You can test it if you create a mailbox like this:

elisabethvazquez@arcosmedic.com

Originally created by @tonioo on GitHub (Dec 4, 2013). Original GitHub issue: https://github.com/modoboa/modoboa/issues/113 Originally assigned to: @tonioo on GitHub. **Originally created by Pedro Gracia on 2010-11-30T12:24:27Z** I find a severe limitation related to username due to django. You can test it if you create a mailbox like this: elisabethvazquez@arcosmedic.com
kerem 2026-02-27 11:10:04 +03:00
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Antoine Nguyen on 2010-11-30T12:47:28Z

I just checked inside Django's source code, you're right this field is limited to 30 characters... By the way, there are some validation problems in 0.8.2 when you create a new mailbox. What do you put inside the address field? elisabethvazquez@arcosmedic.com or just elisabethvazquez?

If you tried with the first one, just try with the other one, I think it will pass.

I'm trying to reproduce this problem with the last development code but without success, it is working pretty well...

<!-- gh-comment-id:29813583 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Antoine Nguyen on 2010-11-30T12:47:28Z** I just checked inside Django's source code, you're right this field is limited to 30 characters... By the way, there are some validation problems in 0.8.2 when you create a new mailbox. What do you put inside the address field? elisabethvazquez@arcosmedic.com or just elisabethvazquez? If you tried with the first one, just try with the other one, I think it will pass. I'm trying to reproduce this problem with the last development code but without success, it is working pretty well...
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Antoine Nguyen on 2010-11-30T12:54:16Z

OMG! The size limit is not understood by sqlite3, this is why I can't reproduce the problem. Indeed, with PostgreSQL an exception is raised :p

I'm going to check that.

<!-- gh-comment-id:29813586 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Antoine Nguyen on 2010-11-30T12:54:16Z** OMG! The size limit is not understood by sqlite3, this is why I can't reproduce the problem. Indeed, with [[PostgreSQL]] an exception is raised :p I'm going to check that.
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Pedro Gracia on 2010-11-30T14:10:15Z

Check this too: http://stackoverflow.com/questions/3812916/which-is-the-easiest-way-to-remove-django-user-models-30-character-limit

<!-- gh-comment-id:29813587 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Pedro Gracia on 2010-11-30T14:10:15Z** Check this too: http://stackoverflow.com/questions/3812916/which-is-the-easiest-way-to-remove-django-user-models-30-character-limit
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Antoine Nguyen on 2010-11-30T20:34:11Z

I think I've got a solution. This limitation seems to be a big problem for a while and django core developers are not going to change that before 1.4!

As I'm not using default forms provided by django and that I'm creating users myself, I can easily add a migration to the admin component that will increase default fields size (username and email for example).

<!-- gh-comment-id:29813589 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Antoine Nguyen on 2010-11-30T20:34:11Z** I think I've got a solution. This limitation seems to be a big problem for a while and django core developers are not going to change that before 1.4! As I'm not using default forms provided by django and that I'm creating users myself, I can easily add a migration to the admin component that will increase default fields size (username and email for example).
Author
Owner

@tonioo commented on GitHub (Dec 4, 2013):

Posted by Redmine Admin on 2010-11-30T20:41:31Z

In [d95ad5a56addd35ebbfa087fdb31b21ec830380c]:

#!CommitTicketReference repository="" revision="d95ad5a56addd35ebbfa087fdb31b21ec830380c"
fixed #100
New migration script to increase the maximum length of username and email fields (too small by default).
<!-- gh-comment-id:29813590 --> @tonioo commented on GitHub (Dec 4, 2013): **Posted by Redmine Admin on 2010-11-30T20:41:31Z** In [d95ad5a56addd35ebbfa087fdb31b21ec830380c]: <pre> #!CommitTicketReference repository="" revision="d95ad5a56addd35ebbfa087fdb31b21ec830380c" fixed #100 New migration script to increase the maximum length of username and email fields (too small by default). </pre>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#97
No description provided.