Skip to content
Snippets Groups Projects
Commit c2fa319f authored by Tore.Brede's avatar Tore.Brede
Browse files

GREG-165: Fixing formatting

parent 031d6bf5
No related branches found
No related tags found
1 merge request!239GREG-165: Part 1 : Handle missing information from Feide
Pipeline #109552 passed
......@@ -73,8 +73,8 @@ class InvitationView(CreateAPIView, DestroyAPIView):
person = serializer.save()
for invitationlink in InvitationLink.objects.filter(
invitation__role__person_id=person.id,
invitation__role__sponsor_id=sponsor_user.sponsor_id,
invitation__role__person_id=person.id,
invitation__role__sponsor_id=sponsor_user.sponsor_id,
):
try:
send_invite_mail(invitationlink)
......@@ -317,7 +317,7 @@ class InvitedGuestView(GenericAPIView):
return Response(status=status.HTTP_200_OK)
def _verify_only_allowed_updates_in_request(
self, person: Person, data
self, person: Person, data
) -> Optional[Response]:
# This is not a case that is expected to happen, but having the check here as a safeguard
# since it is an indication of a bug if does
......@@ -384,13 +384,17 @@ class InvitedGuestView(GenericAPIView):
@staticmethod
def _verified_fnr_already_exists(person) -> bool:
return person.identities.filter(
Q(type=Identity.IdentityType.NORWEGIAN_NATIONAL_ID_NUMBER) &
~Q(verified=None)).first() is not None
return (
person.identities.filter(
Q(type=Identity.IdentityType.NORWEGIAN_NATIONAL_ID_NUMBER)
& ~Q(verified=None)
).first()
is not None
)
@staticmethod
def _get_identity_or_none(
person: Person, identity_type: Identity.IdentityType
person: Person, identity_type: Identity.IdentityType
) -> Optional[str]:
try:
return person.identities.get(type=identity_type).value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment