#29176 closed Bug (fixed)
User.normalize_username() crashes if username isn't a string
| Reported by: | Christophe Mehay | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.auth | Version: | 2.0 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | yes | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I use phone_number module for my username field in Auth module and since I migrated my project to django2, the classmethod normalize_username tries to normalise data which are not a string.
A simple patch would be to check username type in this method and normalize only if the type is a string.
Change History (3)
comment:1 by , 8 years ago
| Has patch: | set |
|---|---|
| Needs tests: | set |
| Summary: | Cannot use a custom username field which is not a string → User.normalize_username() crashes if username isn't a string |
| Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
PR (needs a test)