mirror of
https://github.com/ansible/awx.git
synced 2026-02-12 15:14:45 -03:30
Fix 500 error due to None data in DAB response (#15562)
* Fix 500 error due to None data in DAB response * NOQA for flake8 failures
This commit is contained in:
@@ -244,7 +244,8 @@ class APIView(views.APIView):
|
||||
if hasattr(self, '__init_request_error__'):
|
||||
response = self.handle_exception(self.__init_request_error__)
|
||||
if response.status_code == 401:
|
||||
response.data['detail'] += _(' To establish a login session, visit') + ' /api/login/.'
|
||||
if response.data and 'detail' in response.data:
|
||||
response.data['detail'] += _(' To establish a login session, visit') + ' /api/login/.'
|
||||
logger.info(status_msg)
|
||||
else:
|
||||
logger.warning(status_msg)
|
||||
|
||||
Reference in New Issue
Block a user