Commit 1241e766 authored by John Red Medrano's avatar John Red Medrano

fixing

parent 63c75ccc
......@@ -14,22 +14,16 @@ def custom_exception_handler(exc, context):
# Update the structure of the response data.
if response is not None:
error_message = {}
# print(exception_handler)
for key, value in response.data.items():
# print(type(value))
print(value)
if type(value) == list and value[0].code == 'blank':
value = value[0].replace('This field', key)
# elif type(value) == dict:
# value = value['non_field_errors']
# print(value['non_field_errors'])
# print("value['non_field_errors']")
# elif type(value) == list:
# # value = f'{value[0]}({key})'
# value = value[0].replace('This field', key)
else:
value = value
elif type(value) == list:
value = value[0]
error_message['code'] = response.status_code
error_message['status'] = 'failed'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment