Skip to content

Commit 286ea7f

Browse files
committed
📚 CMS system
1 parent eb4107e commit 286ea7f

File tree

18 files changed

+3629
-193
lines changed

18 files changed

+3629
-193
lines changed

app/api/auth.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ def student_user_auth(
217217
school=class_group.school,
218218
)
219219
school = class_group.school
220+
if not school:
221+
raise HTTPException(status_code=401, detail="Invalid class group")
220222

221223
logger.debug("Get the user by username")
222224
# if the school doesn't match -> 401

app/api/dependencies/stripe_security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import stripe as stripe
1+
import stripe
22
from fastapi import Header, HTTPException, Request
33
from starlette import status
44
from structlog import get_logger

app/api/schools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ async def bulk_add_schools(
304304
try:
305305
session.commit()
306306
return {"msg": f"Added {len(new_schools)} new schools"}
307-
except sqlalchemy.exc.IntegrityError:
307+
except IntegrityError:
308308
logger.warning("there was an issue importing bulk school data")
309309
raise HTTPException(500, "Error bulk importing schools")
310310

0 commit comments

Comments
 (0)