Skip to content

Commit 9067a2d

Browse files
committed
Fixed an issue where a user record without matching person record will cause an exception.
- Legacy-Id: 15478
1 parent 5b3c961 commit 9067a2d

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ietf/ietfauth/views.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
from django.contrib.auth.models import User
4949
from django.contrib.auth.views import LoginView
5050
from django.contrib.sites.models import Site
51+
from django.core.exceptions import ObjectDoesNotExist
5152
from django.core.validators import ValidationError
5253
from django.urls import reverse as urlreverse
5354
from django.utils.safestring import mark_safe
@@ -587,8 +588,11 @@ def login(request, extra_context=None):
587588
user = User.objects.filter(username=username).first()
588589
#
589590
if user:
590-
if user.person and not user.person.consent:
591-
require_consent = user.person.needs_consent()
591+
try:
592+
if user.person and not user.person.consent:
593+
require_consent = user.person.needs_consent()
594+
except ObjectDoesNotExist:
595+
pass
592596
try:
593597
identify_hasher(user.password)
594598
except ValueError:

0 commit comments

Comments
 (0)