openid usernames not using valid django characters

Bug #388890 reported by Stuart Metcalfe
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
django-openid-auth
New
Undecided
Unassigned

Bug Description

When using the username supplied by the openid provider, we should remove or substitute characters not valid for django usernames. An example of this is if you have a hyphen character in your launchpad username. You are able to login to the django site and your username is accepted and stored but attempts to edit the user in the admin ui result in an error from django stating that the username contains invalid characters.

Revision history for this message
nbv4 (nbvfour) wrote :

heres a quick fix for this one (untested)

Revision history for this message
nbv4 (nbvfour) wrote :
Revision history for this message
Chris Beaven (smileychris) wrote :

http://code.djangoproject.com/changeset/12634 introduces a more relaxed set of [\w.@+-]

The username probably should also be truncated to 30 characters (and you'd need to truncate to less when adding numbers to find a unique username too)

Revision history for this message
Michael Nelson (michael.nelson) wrote :

As per bug 746353, we could also just modify the validation for the admin user form - the openid usernames are fine in terms of model-level validation, it's just the admin form uses a slug form field for validation. That way we'd not be losing info (in most cases, not when we have username clashes from different providers).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.