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

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

* commit 'bb851df9':
  refactor upload
parents 8a73e3b9 bb851df9
...@@ -44,11 +44,15 @@ class MasterAttachmentViewSet(viewsets.ModelViewSet): ...@@ -44,11 +44,15 @@ class MasterAttachmentViewSet(viewsets.ModelViewSet):
for instance in self.request.data.getlist(key): for instance in self.request.data.getlist(key):
body = {} body = {}
data = MasterAttachment.objects.create(url=instance) data = MasterAttachment.objects.create(
url=instance,
attch_ref=key
)
file_name = str(data.url).split('/') file_name = str(data.url).split('/')
body['id'] = data.id body['id'] = data.id
body['file_name'] = instance.name body['file_name'] = instance.name
body['attch_ref'] = key
attachments.append(body) attachments.append(body)
return Response( return Response(
......
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