Commit c0703d79 authored by John Red Medrano's avatar John Red Medrano

Merge pull request #751 in RMS/api-main-service from core-dev-red-develop to RMSv2

* commit '01dfb550':
  {dev bugfix} removed the comment error_fuction to make it clean
  {dev bugfix} move function error_message from decorators.py to utils.py
parents 7309c7db 01dfb550
...@@ -17,6 +17,17 @@ import json ...@@ -17,6 +17,17 @@ import json
REALTIMESERVER_IP = settings.REALTIMESERVER_IP REALTIMESERVER_IP = settings.REALTIMESERVER_IP
def error_message(code, message, status, status_code):
return Response(
{
"code": code,
"message": message,
"status": status
},
status=status_code
)
def model_to_dict(instance): def model_to_dict(instance):
try: try:
mySerializer = copy.deepcopy(DynamicSerializer) mySerializer = copy.deepcopy(DynamicSerializer)
......
...@@ -13,18 +13,9 @@ from app.businesslayer.changerequest.change_request_template import ( ...@@ -13,18 +13,9 @@ from app.businesslayer.changerequest.change_request_template import (
validation_existing_vendor_requestor, validation_existing_vendor_requestor,
validation_existing_approver validation_existing_approver
) )
from app.applicationlayer.utils import error_message
def error_message(code, message, status, status_code):
return Response(
{
"code": code,
"message": message,
"status": status
},
status=status_code
)
def error_safe(function): def error_safe(function):
def wrap(request, *args, **kwargs): def wrap(request, *args, **kwargs):
stat = status.HTTP_500_INTERNAL_SERVER_ERROR stat = status.HTTP_500_INTERNAL_SERVER_ERROR
......
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