From dddb431d33ab7affac53db88eab499a140d4508e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 18 Apr 2024 11:07:46 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=94=A8=20fix=20case=20sensitive=20fil?= =?UTF-8?q?ename=20calls=20=F0=9F=99=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/elements/PrimaryButton.vue | 2 +- frontend/src/elements/SecondaryButton.vue | 2 +- frontend/src/elements/TextButton.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/elements/PrimaryButton.vue b/frontend/src/elements/PrimaryButton.vue index 54cbe2ba9..ec950cfc8 100644 --- a/frontend/src/elements/PrimaryButton.vue +++ b/frontend/src/elements/PrimaryButton.vue @@ -36,7 +36,7 @@ From b004c10ef26c87326e7315b10c5fa814b9278ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 18 Apr 2024 11:24:07 +0200 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A8=20extend=20schedule=20test=20w?= =?UTF-8?q?ith=20attendee=20timezone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/test/integration/test_schedule.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/test/integration/test_schedule.py b/backend/test/integration/test_schedule.py index 469107eee..2e750d267 100644 --- a/backend/test/integration/test_schedule.py +++ b/backend/test/integration/test_schedule.py @@ -462,7 +462,8 @@ def bust_cached_events(self, all_calendars = False): ), attendee=schemas.AttendeeBase( email='hello@example.org', - name='Greg' + name='Greg', + timezone='Europe/Berlin' ) ).model_dump(mode='json') From f6da10741a51b2463c13726bca30bc28484de761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 18 Apr 2024 17:30:28 +0200 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=A8=20Make=20attendee=20timezone?= =?UTF-8?q?=20mandatory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/appointment/database/schemas.py | 2 +- backend/src/appointment/routes/schedule.py | 6 +++++- backend/test/unit/test_mailer.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/src/appointment/database/schemas.py b/backend/src/appointment/database/schemas.py index d1ad20896..9885e0b51 100644 --- a/backend/src/appointment/database/schemas.py +++ b/backend/src/appointment/database/schemas.py @@ -30,7 +30,7 @@ class AttendeeBase(BaseModel): email: str name: str | None = None - timezone: str | None = None + timezone: str class Attendee(AttendeeBase): diff --git a/backend/src/appointment/routes/schedule.py b/backend/src/appointment/routes/schedule.py index ef38c2a43..b07b40fe3 100644 --- a/backend/src/appointment/routes/schedule.py +++ b/backend/src/appointment/routes/schedule.py @@ -421,5 +421,9 @@ def decide_on_schedule_availability_slot( return schemas.AvailabilitySlotAttendee( slot=schemas.SlotBase(start=slot.start, duration=slot.duration), - attendee=schemas.AttendeeBase(email=slot.attendee.email, name=slot.attendee.name) + attendee=schemas.AttendeeBase( + email=slot.attendee.email, + name=slot.attendee.name, + timezone=slot.attendee.timezone + ) ) diff --git a/backend/test/unit/test_mailer.py b/backend/test/unit/test_mailer.py index 25b75c3b2..edfb3a81c 100644 --- a/backend/test/unit/test_mailer.py +++ b/backend/test/unit/test_mailer.py @@ -17,7 +17,7 @@ def test_confirm(self, faker, with_l10n): deny_url = 'https://example.org/no' fake_email = 'to@example.org' now = datetime.datetime.now() - attendee = schemas.AttendeeBase(email=faker.email(), name=faker.name()) + attendee = schemas.AttendeeBase(email=faker.email(), name=faker.name(), timezone='Europe/Berlin') mailer = ConfirmationMail(confirm_url, deny_url, attendee, now, to=fake_email) assert mailer.html() From 9a7b75294ba7c228a4487d8fb348c55e9c4b605d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 18 Apr 2024 17:33:31 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=94=A8=20Fix=20appointment=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/test/integration/test_appointment.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/test/integration/test_appointment.py b/backend/test/integration/test_appointment.py index a9f1c12e3..87d3c95a6 100644 --- a/backend/test/integration/test_appointment.py +++ b/backend/test/integration/test_appointment.py @@ -338,7 +338,7 @@ def test_attendee_selects_slot_of_unavailable_appointment(self, with_db, with_cl response = with_client.put( f"/apmt/public/{generated_appointment.slug}", - json={"slot_id": generated_appointment.slots[-1].id, "attendee": {"email": "a", "name": "b"}}, + json={"slot_id": generated_appointment.slots[-1].id, "attendee": {"email": "a", "name": "b", "timezone": "c"}}, ) assert response.status_code == 403, response.text @@ -347,7 +347,7 @@ def test_attendee_selects_slot_of_missing_appointment(self, with_client, make_ap response = with_client.put( f"/apmt/public/{generated_appointment}", - json={"slot_id": generated_appointment.slots[0].id, "attendee": {"email": "a", "name": "b"}}, + json={"slot_id": generated_appointment.slots[0].id, "attendee": {"email": "a", "name": "b", "timezone": "c"}}, ) assert response.status_code == 404, response.text @@ -356,7 +356,7 @@ def test_attendee_selects_missing_slot_of_existing_appointment(self, with_client response = with_client.put( f"/apmt/public/{generated_appointment.id}", - json={"slot_id": generated_appointment.slots[0].id + 1, "attendee": {"email": "a", "name": "b"}}, + json={"slot_id": generated_appointment.slots[0].id + 1, "attendee": {"email": "a", "name": "b", "timezone": "c"}}, ) assert response.status_code == 404, response.text