Commit 63c75ccc authored by John Red Medrano's avatar John Red Medrano

fixing

parent 2e827f53
......@@ -18,17 +18,18 @@ def custom_exception_handler(exc, context):
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)
# elif type(value) == list:
# # value = f'{value[0]}({key})'
# value = value[0].replace('This field', key)
else:
value = value[0]
value = value
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