From 497b7b76ff298e67185b3cb79c90d61ab37d11a3 Mon Sep 17 00:00:00 2001
From: Jonas Braathen <jonas.braathen@usit.uio.no>
Date: Wed, 24 Nov 2021 09:08:03 +0100
Subject: [PATCH] Remove stray lines

---
 gregui/api/views/invitation.py            | 3 +--
 gregui/tests/api/views/test_invitation.py | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/gregui/api/views/invitation.py b/gregui/api/views/invitation.py
index af633e83..2a36d024 100644
--- a/gregui/api/views/invitation.py
+++ b/gregui/api/views/invitation.py
@@ -288,8 +288,7 @@ class InvitedGuestView(GenericAPIView):
 
     @staticmethod
     def _illegal_fields(request_data, changeable_fields) -> List[str]:
-        # Check how many of the allowed fields are filled in
-        person_data = request_data["person"]
+        person_data = request_data.get("person", {})
         changed_fields = person_data.keys()
         return list(set(changed_fields) - set(changeable_fields))
 
diff --git a/gregui/tests/api/views/test_invitation.py b/gregui/tests/api/views/test_invitation.py
index 5883fea7..fba3f5d0 100644
--- a/gregui/tests/api/views/test_invitation.py
+++ b/gregui/tests/api/views/test_invitation.py
@@ -433,7 +433,6 @@ def test_invalid_date_of_birth_rejected(client, invited_person_verified_nin):
 
     person = Person.objects.get()
     assert person.date_of_birth is None
-    response = client.post(url, data, format="json")
 
 
 @pytest.mark.django_db
-- 
GitLab