Code

Opened 6 years ago

Closed 5 years ago

#7507 closed (duplicate)

contrib.auth login form shouldn't limit username to 30 chars

Reported by: SmileyChris Owned by:
Component: contrib.auth Version: newforms-admin
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

That's only relevant if you're using the User model, and the form shouldn't be so tightly coupled with that since alternate auth backends can be used. (I for one am encountering this as a problem).

Attachments (1)

7507.diff (5.9 KB) - added by SmileyChris 6 years ago.
Patch for r8061 (post NFA merge)

Download all attachments as: .zip

Change History (7)

comment:1 Changed 6 years ago by SmileyChris

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Oops, that's a whole lot of whitespace my editor removed too.

Note that my patch also throws in a very minor fix to use return self.user_cache.pk rather than .id in get_user_id()

The only problem this could cause is if db backends fail if you try to compare a long string against a short char db field. I don't think this is the case, just noting a potential caveat. If this is the case, then the default backend could be fixed to skip any auth attempts with more than 30 char usernames.

comment:2 Changed 6 years ago by serialx

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by SmileyChris

This probably should be fixed against newforms admin, right?

comment:4 Changed 6 years ago by Alex

I would think so, since NFA switched auth to use newforms.

Changed 6 years ago by SmileyChris

Patch for r8061 (post NFA merge)

comment:5 Changed 6 years ago by SmileyChris

Closed in favour of #9168

comment:6 Changed 5 years ago by gwilson

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

and #9168 closed in favor of #8274.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.