Changes between Initial Version and Version 1 of Ticket #19354


Ignore:
Timestamp:
11/24/12 09:10:23 (2 years ago)
Author:
claudep
Comment:

Reformatted, please use preview.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19354

    • Property Patch needs improvement unset
    • Property Needs tests unset
    • Property Needs documentation unset
  • 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