Commit e4f0c49e authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg

Fix saving of order for admins from pizza API

parent ef6f7506
......@@ -80,7 +80,9 @@ class OrderViewset(ModelViewSet):
if serializer.validated_data.get('name'):
serializer.save(pizza_event=PizzaEvent.current())
else:
if self.request.user.has_perm('pizzas.change_order'):
if (self.action.endswith('update') and
can_change_order(self.request.member,
PizzaEvent.current())):
serializer.save(pizza_event=PizzaEvent.current())
else:
serializer.save(member=self.request.member,
......
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