From ea96e74c64bdb9dce4be1682835f91115d12d9f3 Mon Sep 17 00:00:00 2001 From: "lukas.bernhard" Date: Sat, 16 Nov 2024 14:50:00 +0100 Subject: [PATCH] make sure emails are lower when inserting and deleting --- schafkopf/api/api.py | 2 +- schafkopf/api/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schafkopf/api/api.py b/schafkopf/api/api.py index 64e0a1e..04bfbf3 100644 --- a/schafkopf/api/api.py +++ b/schafkopf/api/api.py @@ -41,7 +41,7 @@ def subscribe_to_schafkopf_rounds(req: SubscribeRequest) -> SubscribeResponse: def delete_subscriber_from_mailing_list(email: str) -> SubscribeResponse: import boto3 dynamodb = boto3.resource("dynamodb") - email_table.delete(dynamodb, email) + email_table.delete(dynamodb, email.lower()) return SubscribeResponse(email=email) diff --git a/schafkopf/api/models.py b/schafkopf/api/models.py index 1acf052..a14da3f 100644 --- a/schafkopf/api/models.py +++ b/schafkopf/api/models.py @@ -12,7 +12,7 @@ class SubscribeRequest(BaseModel): email: str def to_email_item(self) -> EmailItem: - return EmailItem(email=self.email) + return EmailItem(email=self.email.lower()) class SubscribeResponse(BaseModel):