Merge branch 'chore-admin-file-structure' of gurusainath:makeplane/plane into chore-admin-file-structure

This commit is contained in:
guru_sainath 2024-05-08 20:20:12 +05:30
commit cf17761c5c

View File

@ -7,6 +7,12 @@ def auth_exception_handler(exc, context):
response = exception_handler(exc, context)
# Check if an AuthenticationFailed exception is raised.
if isinstance(exc, NotAuthenticated):
response.status_code = 401
# Return 403 if the users me api fails
request = context["request"]
if request.path == "/api/users/me/":
response.status_code = 403
# else return 401
else:
response.status_code = 401
return response