Changes between Initial Version and Version 1 of Ticket #19354


Ignore:
Timestamp:
Nov 24, 2012, 9:10:23 AM (12 years ago)
Author:
Claude Paroz
Comment:

Reformatted, please use preview.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19354 – Description

    initial v1  
    22I've written a custom user model, and wished to set a field as the primary key. See the example below.
    33
     4{{{
    45class User(AbstractBaseUser):
    56    email = models.EmailField(_('email'), max_length=75, unique=True, primary_key=True)
     
    78    USERNAME_FIELD = 'email'
    89    ...
    9 
     10}}}
    1011Registering the user works fine, but when I authenticate the user using django.contrib.auth.views.login, I get an error stating that the 'User' object has no attribute 'id'.
    1112
     
    1516
    1617Here's a summary of the error report:
     18{{{
    1719Exception Type: AttributeError
    1820Exception Value: 'User' object has no attribute 'id'
     
    2022Python Executable:      <path>/bin/python
    2123Python Version: 2.6.5
     24}}}
    2225
    2326Regards,
Back to Top