Error response

This commit is contained in:
jain
2023-08-21 19:09:44 +05:30
parent e380f3f6ab
commit 214566ec8f
2 changed files with 2 additions and 2 deletions

View File

@ -204,7 +204,7 @@ def custom_error_response(detail, response_status):
if not detail:
"""when details is empty"""
detail = {}
return Response({"error": detail, "status": "failed", "code": response_status})
return Response({"error": detail, "status": "failed", "code": response_status}, status=status.HTTP_400_BAD_REQUEST)
def get_user_data(attrs):