add event

This commit is contained in:
2025-07-05 15:02:28 -03:00
parent 208c43f398
commit 0df4d7aa71
9 changed files with 96 additions and 51 deletions

View File

@@ -55,12 +55,7 @@ def lambda_handler(event: EventBridgeEvent, context: LambdaContext) -> bool:
return True
class CourseNotFoundError(Exception):
def __init__(self, *args):
super().__init__('Course not found')
def _get_course(course_id: str) -> dict:
def _get_course(course_id: str) -> dict | None:
with sqlite3.connect(
database=SQLITE_DATABASE, detect_types=sqlite3.PARSE_DECLTYPES
) as conn:
@@ -70,4 +65,4 @@ def _get_course(course_id: str) -> dict:
for row in rows:
return row['json']
raise CourseNotFoundError
return None