Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
WebMon9099 committed Dec 18, 2024
1 parent c4a859e commit e98505b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/api/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,10 @@ def uploadImage(id):
if token is None:
if account_type == Account.PARTNER:
account = PartnerProfile.objects.get(id=id)
elif account_type == Account.MENTEE:
account = MenteeProfile.objects.get(id=id)
elif account_type == Account.MENTOR:
account = MentorProfile.objects.get(id=id)
else:
msg = "Level param doesn't match existing account types"
return create_response(status=422, message=msg)
Expand All @@ -689,7 +693,6 @@ def uploadImage(id):
and int(login_user_role) != Account.HUB
):
return response

if account_type == Account.MENTEE:
account = MenteeProfile.objects.get(id=id)
elif account_type == Account.MENTOR:
Expand All @@ -701,6 +704,7 @@ def uploadImage(id):
elif account_type == Account.ADMIN:
account = Admin.objects.get(id=id)


else:
msg = "Level param doesn't match existing account types"
return create_response(status=422, message=msg)
Expand Down

0 comments on commit e98505b

Please sign in to comment.