some parts of product - fix custom pagination - add id to pages list
This commit is contained in:
@@ -7,8 +7,9 @@ def custom_exception_handler(exc, context):
|
||||
|
||||
if response is not None:
|
||||
response.data['status_code'] = response.status_code
|
||||
response.data['message'] = response.data.get('detail', str(exc))
|
||||
del response.data['detail']
|
||||
if response.data.get('detail'):
|
||||
response.data['message'] = response.data.get('detail', str(exc))
|
||||
del response.data['detail']
|
||||
else:
|
||||
response = JsonResponse({'message': str(exc), 'status_code': 500})
|
||||
response.status_code = 500
|
||||
|
||||
Reference in New Issue
Block a user