Commit 9bf88ade authored by John Red Medrano's avatar John Red Medrano

fixed bug on attachments

parent 61b95854
......@@ -40,9 +40,9 @@ class MasterAttachmentViewSet(viewsets.ModelViewSet):
@transaction.atomic
def create(self, request, *args, **kwargs):
attachments = []
body = {}
for instance in self.request.data.getlist('url'):
body = {}
data = MasterAttachment.objects.create(url=instance)
file_name = str(data.url).split('/')
......
......@@ -13,9 +13,11 @@ def custom_exception_handler(exc, context):
# Update the structure of the response data.
if response is not None:
print('dd')
error_message = {}
for key, value in response.data.items():
print(value)
if type(value) == list and value[0].code == 'blank':
value = value[0].replace('This field', key)
# elif type(value) == dict:
......
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