diff --git a/backend/app/routers/flashcards.py b/backend/app/routers/flashcards.py index 1fe79f5..8970082 100644 --- a/backend/app/routers/flashcards.py +++ b/backend/app/routers/flashcards.py @@ -50,7 +50,9 @@ class FlashcardDeckResponse(BaseModel): # them as "Uncategorized" and an educator refiled a deck the system had # already filed correctly. category_id: int | None = None - user_id: int + # Nullable: bank content has no owner, and a schema that promises an + # int where the column says NULL is a 500 on serialisation. + user_id: int | None = None card_count: int is_shared: int = 0 created_at: object @@ -81,7 +83,9 @@ class FlashcardDeckDetail(BaseModel): id: int title: str section_id: int | None = None - user_id: int + # Nullable: bank content has no owner, and a schema that promises an + # int where the column says NULL is a 500 on serialisation. + user_id: int | None = None card_count: int created_at: object cards: list[FlashcardCardResponse] diff --git a/backend/app/schemas/document.py b/backend/app/schemas/document.py index c6b021f..191e0b4 100644 --- a/backend/app/schemas/document.py +++ b/backend/app/schemas/document.py @@ -36,7 +36,9 @@ class SectionResponse(BaseModel): class DocumentResponse(BaseModel): id: int - user_id: int + # Nullable: bank content has no owner, and a schema that promises an + # int where the column says NULL is a 500 on serialisation. + user_id: int | None = None original_filename: str total_pages: int | None status: str diff --git a/backend/app/schemas/quiz.py b/backend/app/schemas/quiz.py index c376b65..94e9f66 100644 --- a/backend/app/schemas/quiz.py +++ b/backend/app/schemas/quiz.py @@ -53,7 +53,9 @@ class QuestionWithAnswer(QuestionResponse): class QuizResponse(BaseModel): id: int section_id: int | None = None - user_id: int + # Nullable: bank content has no owner, and a schema that promises an + # int where the column says NULL is a 500 on serialisation. + user_id: int | None = None title: str questions_count: int mode: str diff --git a/backend/app/services/email_service.py b/backend/app/services/email_service.py index e4aebd5..c8edfba 100644 --- a/backend/app/services/email_service.py +++ b/backend/app/services/email_service.py @@ -167,52 +167,3 @@ We received a request to reset your password. Click below to choose a new one. [link:Or copy this link]({url}) """ await _send(to_email, subject, _wrap(subject, md)) - - -async def send_login_code_email(to_email: str, name: str, code: str): - """The code, and as little else as possible. - - One thing is being asked of the reader — read six characters and type them - — so the code is the biggest thing on the screen and everything else is - underneath it in the order it matters: which account this signs into, a way - back to the page, and permission to ignore the whole thing. - - Written as its own centred block rather than through the markdown renderer: - the renderer lays out prose left to right, which is right for every other - message we send and wrong for this one. - """ - #: The code arrives here already grouped for reading; any shape it is typed - #: back in is normalised before it is compared. - subject = "Sign in to PedsHub" - body = f""" -
- Enter this code to sign in as
- {to_email}
-
- The code works once and expires in 15 minutes.
- If you didn't try to log in, you can ignore this email.
-