forked from wiktor/spejstore-new
Allow label printing api to print multiple copies of a label
This commit is contained in:
parent
35da79f0b2
commit
93ebd810aa
|
@ -32,7 +32,9 @@ class LabelViewSet(viewsets.ModelViewSet):
|
|||
|
||||
@detail_route(methods=['post'], permission_classes=[AllowAny])
|
||||
def print(self, request, pk):
|
||||
quantity = min(int(request.query_params.get('quantity', 1)), 5)
|
||||
obj = self.get_object()
|
||||
for _ in range(quantity):
|
||||
obj.print()
|
||||
return obj
|
||||
|
||||
|
|
Loading…
Reference in New Issue