From 3c3a33448a8d270e82cac14babeef1ead021c20e Mon Sep 17 00:00:00 2001 From: Tim Beccue Date: Wed, 4 Dec 2024 00:42:25 -0500 Subject: [PATCH] Fix incorrect casing --- import_schedules.py | 2 +- utils.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/import_schedules.py b/import_schedules.py index 6e369a7..8d4c235 100644 --- a/import_schedules.py +++ b/import_schedules.py @@ -238,7 +238,7 @@ def clear_old_schedule(site, cutoff_time=None): query = calendar_table.query( IndexName=index_name, KeyConditionExpression=Key('site').eq(site) & Key('end').gt(cutoff_time), - FilterExpression=Attr('origin').eq('lco') & Attr('start').gt(cutoff_time) + FilterExpression=Attr('origin').eq('LCO') & Attr('start').gt(cutoff_time) ) items = query.get('Items', []) print(f"Removing expired scheduled events: {items}") diff --git a/utils.py b/utils.py index d07da53..6108552 100644 --- a/utils.py +++ b/utils.py @@ -130,7 +130,6 @@ def get_project(project_name, created_at): def delete_calendar_event(event_id, start_time, user_making_request=None, requester_is_admin=True): """Deletes an event from the DynamoDB table with optional authorization check.""" - try: # Perform the delete operation response = calendar_table.delete_item( @@ -142,7 +141,7 @@ def delete_calendar_event(event_id, start_time, user_making_request=None, reques ExpressionAttributeValues = { ":requester_id": user_making_request, ":requesterIsAdmin": requester_is_admin, - ":true": "true" + ":true": True } ) return response # Return the raw response data (typically including `Item` if success)