Skip to content

Commit a65f832

Browse files
committed
fix: address code review
1 parent 7262d5b commit a65f832

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/officers/urls.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ async def all_officers(
106106
""",
107107
response_model=list[OfficerTermResponse],
108108
responses={
109-
401: { "description": "not authorized to view private info", "model": DetailModel }
109+
401: { "description": "not logged in", "model": DetailModel },
110+
403: { "description": "not authorized to view private info", "model": DetailModel }
110111
},
111112
operation_id="get_officer_terms_by_id"
112113
)
@@ -201,7 +202,7 @@ async def create_officer_term(
201202
return JSONResponse({ "success": True })
202203

203204
@router.patch(
204-
"/info/{computing_id:str}",
205+
"/info/{computing_id}",
205206
description="""
206207
After election, officer computing ids are input into our system.
207208
If you have been elected as a new officer, you may authenticate with SFU CAS,
@@ -237,7 +238,7 @@ async def update_officer_info(
237238
return JSONResponse(updated_officer_info.serializable_dict())
238239

239240
@router.patch(
240-
"/term/{term_id:int}",
241+
"/term/{term_id}",
241242
description="Update the information for an Officer's term",
242243
response_model=OfficerTermResponse,
243244
responses={

src/permission/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ async def has_permission_or_raise(
7676
errmsg:str = "must have website admin permissions"
7777
) -> bool:
7878
if not await WebsiteAdmin.has_permission(db_session, computing_id):
79-
raise HTTPException(status_code=401, detail=errmsg)
79+
raise HTTPException(status_code=403, detail=errmsg)
8080
return True

0 commit comments

Comments
 (0)