Skip to content

Commit

Permalink
Update error_views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
liyaqin1 authored May 31, 2024
1 parent a5de10c commit 0d4eabb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions deploy-board/deploy_board/webapp/error_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ def process_exception(self, request, exception):
if request.is_ajax():
ajax_vars = {'success': False, 'error': str(exception)}
ret = 500
if isinstance(exception, NotAuthorizedException):
ret = 403
elif isinstance(exception, FailedAuthenticationException):
if isinstance(exception, FailedAuthenticationException):
ret = 401
elif isinstance(exception, NotAuthorizedException):
ret = 403
elif isinstance(exception, NotFoundException):
ret = 404
return HttpResponse(json.dumps(ajax_vars), status=ret, content_type='application/javascript')
else:
# Not authorized
Expand Down

0 comments on commit 0d4eabb

Please sign in to comment.