insert , to origin list
This commit is contained in:
@@ -290,7 +290,7 @@ CORS_ALLOWED_ORIGINS = (
|
|||||||
'http://127.0.0.1:3000',
|
'http://127.0.0.1:3000',
|
||||||
'http://localhost:3000',
|
'http://localhost:3000',
|
||||||
'http://192.168.88.130:3000',
|
'http://192.168.88.130:3000',
|
||||||
'https://rasadyar.net'
|
'https://rasadyar.net',
|
||||||
'https://rasaddam-front.liara.run'
|
'https://rasaddam-front.liara.run'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class TagAssignment(BaseModel):
|
|||||||
('A', 'Accept'),
|
('A', 'Accept'),
|
||||||
('W', 'Waiting'),
|
('W', 'Waiting'),
|
||||||
('C', 'Cancel'),
|
('C', 'Cancel'),
|
||||||
|
('E', 'Exited'),
|
||||||
)
|
)
|
||||||
status = models.CharField(max_length=1, choices=status_choices, default="W")
|
status = models.CharField(max_length=1, choices=status_choices, default="W")
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class TagAssignmentViewSet(viewsets.ModelViewSet):
|
|||||||
f'tag_assignment_document_{assignment.serial}.{str(document).split(".")[1]}'
|
f'tag_assignment_document_{assignment.serial}.{str(document).split(".")[1]}'
|
||||||
)
|
)
|
||||||
assignment.document = document_url
|
assignment.document = document_url
|
||||||
assignment.status = 'A'
|
assignment.status = 'E'
|
||||||
assignment.save()
|
assignment.save()
|
||||||
serializer = self.serializer_class(assignment)
|
serializer = self.serializer_class(assignment)
|
||||||
return Response(serializer.data, status=status.HTTP_200_OK)
|
return Response(serializer.data, status=status.HTTP_200_OK)
|
||||||
@@ -192,6 +192,21 @@ class TagAssignmentViewSet(viewsets.ModelViewSet):
|
|||||||
|
|
||||||
return Response(status.HTTP_200_OK)
|
return Response(status.HTTP_200_OK)
|
||||||
|
|
||||||
|
@action(
|
||||||
|
methods=['post'],
|
||||||
|
detail=True,
|
||||||
|
url_name='remove_tags_by_id',
|
||||||
|
url_path='remove_tags_by_id',
|
||||||
|
name='remove_tags_by_id'
|
||||||
|
)
|
||||||
|
def remove_assigned_tags_by_id(self, request, pk=None):
|
||||||
|
allocated_tag = tag_models.AllocatedTags.objects.filter(id__in=request.data['allocated_tag_ids'])
|
||||||
|
for obj in allocated_tag:
|
||||||
|
obj.tag.status = 'F'
|
||||||
|
obj.tag.save()
|
||||||
|
allocated_tag.delete()
|
||||||
|
return Response(status.HTTP_200_OK)
|
||||||
|
|
||||||
@action(
|
@action(
|
||||||
methods=['put'],
|
methods=['put'],
|
||||||
detail=True,
|
detail=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user