Project

General

Profile

Bug #26711

AttributeError: 'NoneType' object has no attribute 'first_name'

Added by Frédéric Péters 7 months ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
25 Sep 2018
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/__init__.py", line 117, in login
    user_logged_in.send(sender=user.__class__, request=request, user=user)
  File "/usr/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 189, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 26, in update_last_login
    user.save(update_fields=['last_login'])
  File "/usr/lib/python2.7/dist-packages/authentic2/custom_user/models.py", line 253, in save
    attribute.set_value(self, getattr(self, attr_name, None))
  File "/usr/lib/python2.7/dist-packages/authentic2/models.py", line 234, in set_value
    defaults={'content': content, 'verified': verified})
  File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 407, in get_or_create
    return self._create_object_from_params(lookup, params)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 439, in _create_object_from_params
    obj = self.create(**params)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 348, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/lib/python2.7/dist-packages/authentic2/models.py", line 291, in save
    setattr(self.owner, self.attribute.name, self.to_python())
AttributeError: 'NoneType' object has no attribute 'first_name'

Aucune idée de comment ça a pu arriver, dans la db il y a bien un AttributeValue, first_name, attaché à l'usager en question.

Also available in: Atom PDF