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

Fixing formatting

parent 8918ff4a
No related branches found
No related tags found
1 merge request!121Adding Feide ID to guest registation page, adding success page in wizard
Pipeline #98021 failed
......@@ -142,8 +142,12 @@ class InvitedGuestView(GenericAPIView):
else SessionType.FEIDE.value
)
fnr = self._get_identity_or_none(person, Identity.IdentityType.NORWEGIAN_NATIONAL_ID_NUMBER)
passport = self._get_identity_or_none(person, Identity.IdentityType.PASSPORT_NUMBER)
fnr = self._get_identity_or_none(
person, Identity.IdentityType.NORWEGIAN_NATIONAL_ID_NUMBER
)
passport = self._get_identity_or_none(
person, Identity.IdentityType.PASSPORT_NUMBER
)
feide_id = self._get_identity_or_none(person, Identity.IdentityType.FEIDE_ID)
data = {
......@@ -154,7 +158,7 @@ class InvitedGuestView(GenericAPIView):
"mobile_phone": person.private_mobile and person.private_mobile.value,
"fnr": fnr,
"passport": passport,
"feide_id": feide_id
"feide_id": feide_id,
},
"sponsor": {
"first_name": sponsor.first_name,
......@@ -241,10 +245,10 @@ class InvitedGuestView(GenericAPIView):
return number_of_fields_filled_in == len(person_data.keys())
@staticmethod
def _get_identity_or_none(person: Person, identity_type: Identity.IdentityType) -> Optional[str]:
def _get_identity_or_none(
person: Person, identity_type: Identity.IdentityType
) -> Optional[str]:
try:
return person.identities.get(
type=identity_type
).value
return person.identities.get(type=identity_type).value
except Identity.DoesNotExist:
return None
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