Opened 6 years ago

Closed 6 years ago

#11579 closed (duplicate)

Increase length of email field to accomodate Facebook proxied addresses

Reported by: graham_king Owned by: nobody
Component: contrib.auth Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The proxied email addresses Facebook provides via it's API look something like this: apps+107627842277.100000147873279.3fbf72360a409641ecb9202d8ac5af5e@…

That's 89 characters long, so it doesn't fit into the 75 characters in django.contrib.auth.models.User.email.

I'd like to suggest increasing that field's max_length to 200.

The only potential downside is that certain databases (Oracle) limit the total potential size of a row. That would only matter if someone heavily extended the auth_user table, which is rare. Usually the profile feature is used.

Can anyone see this causing a problem?

Change History (2)

comment:1 Changed 6 years ago by graham_king

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I would suggest doing this to all EmailField, so changing

django.db.models.field.__init__.py

line 641:

kwargs['max_length'] = kwargs.get('max_length', 75)

to replace the 75 with a 200. If this pushed a user table over the limit you can always pass max_length to EmailField.

The safer way is to add a max_length to auth.User's EmailField.

comment:2 Changed 6 years ago by russellm

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #11365, and I suspect a few others.

Note: See TracTickets for help on using tickets.
Back to Top