Changes between Initial Version and Version 1 of Ticket #28594


Ignore:
Timestamp:
Sep 13, 2017, 3:22:09 PM (7 years ago)
Author:
Tim Graham
Comment:

Can you propose a patch for Django?

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28594 – Description

    initial v1  
    11problem:
    2 While upgrading from 1.9 to 1.11, ForwardManyToOneDescriptor.__set__()
    3 tries to assign a string (description of the related instance) to the related user name field
    4 of user model.
     2While upgrading from 1.9 to 1.11, `ForwardManyToOneDescriptor.__set__()` tries to assign a string (description of the related instance) to the related user name field of user model.
    53diagnosis:
    6 In 1.10 normalize_username(), a class method of AbstractBaseUser, has been introduced.
    7 This class method forces the related user name instance to a string.
     4In 1.10 `normalize_username()`, a class method of `AbstractBaseUser`, has been introduced. This class method forces the related user name instance to a string.
    85Fix:
    96Overwriting this with a method which just returns the 'username' fixes the problem.
    107
    118Details:
    12 
     9{{{
    1310class AbstractEmailUser(AbstractBaseUser, PermissionsMixin, FieldlistForDetailTemplateMixin):
    1411   localemail = models.OneToOneField('Mailbox', verbose_name=_('Local E-mail'),
     
    8683ValueError: Cannot assign "'unpriv@framailx.de'": "Account.localemail" must be a "Mailbox" instance.
    8784[21/Aug/2017 16:08:37] "POST /admin/erdb/account/19/change/ HTTP/1.1" 500 166385
    88 
     85}}}
    8986Discussion:
    9087https://www.mail-archive.com/django-users@googlegroups.com/msg178769.html
Back to Top