diff --git a/gregui/api/serializers/guest.py b/gregui/api/serializers/guest.py index ecdb652c5de590faede392fc0c269c44b9755df0..481bbfdf48e19989884f738c8be454f7ab733945 100644 --- a/gregui/api/serializers/guest.py +++ b/gregui/api/serializers/guest.py @@ -10,12 +10,10 @@ class GuestRegisterSerializer(serializers.ModelSerializer): class Meta: model = Person - fields = ("id", "first_name", "last_name", "date_of_birth") + fields = ("id", "first_name", "last_name", "email") read_only_fields = ("id",) extra_kwargs = { "first_name": {"required": True}, "last_name": {"required": True}, - "date_of_birth": {"required": True}, - # 'email': {'required': True}, - # 'phone_number': {'required': True}, + "email": {"required": True}, } diff --git a/gregui/tests/api/test_guest.py b/gregui/tests/api/test_guest.py index 17102f7634fb8973f86a34d8e41715bb930025d4..29e3f83f48b160ec00a221903a1686421a2bf5eb 100644 --- a/gregui/tests/api/test_guest.py +++ b/gregui/tests/api/test_guest.py @@ -6,7 +6,7 @@ from rest_framework.reverse import reverse @pytest.mark.django_db def test_register_guest(client): - data = {"first_name": "Foo", "last_name": "Bar", "date_of_birth": "2020-09-21"} + data = {"first_name": "Foo", "last_name": "Bar", "email": "test@example.com"} url = reverse("gregui-v1:guest-register") response = client.post(url, data) assert response.status_code == status.HTTP_201_CREATED