prepare allocate tags to organizations api

This commit is contained in:
2025-05-27 15:09:22 +03:30
parent bc710c74c6
commit 6f8f9463b0
29 changed files with 951 additions and 48 deletions

View File

@@ -0,0 +1,15 @@
from django.http import JsonResponse
from rest_framework.views import exception_handler
def custom_exception_handler(exc, context):
response = 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']
else:
response = JsonResponse({'message': str(exc), 'status_code': 500})
response.status_code = 500
return response