File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ async def validate_otp(
325325 hackatime_data = None
326326 try :
327327 hackatime_data = get_account (otp_client_response .email )
328- except Exception as e : # type: ignore # pylint: disable=broad-exception-caught
328+ except Exception : # type: ignore # pylint: disable=broad-exception-caught
329329 pass # unable to fetch hackatime data, continue anyway
330330 user = User (
331331 email = otp_client_response .email ,
Original file line number Diff line number Diff line change @@ -219,6 +219,11 @@ async def link_hackatime_project(
219219 """Link a Hackatime project to a user project"""
220220 user_email = request .state .user ["sub" ]
221221
222+ if hackatime_project .name == "" :
223+ raise HTTPException (
224+ status_code = 400 , detail = "Hackatime project name cannot be empty"
225+ )
226+
222227 project_raw = await session .execute (
223228 sqlalchemy .select (UserProject ).where (
224229 UserProject .id == project_id , UserProject .user_email == user_email
@@ -285,6 +290,11 @@ async def unlink_hackatime_project(
285290 """Unlink a Hackatime project from a user project"""
286291 user_email = request .state .user ["sub" ]
287292
293+ if hackatime_project .name == "" :
294+ raise HTTPException (
295+ status_code = 400 , detail = "Hackatime project name cannot be empty"
296+ )
297+
288298 project_raw = await session .execute (
289299 sqlalchemy .select (UserProject ).where (
290300 UserProject .id == project_id , UserProject .user_email == user_email
You can’t perform that action at this time.
0 commit comments