1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-12-15 15:37:11 +01:00

Prepare for first irl test

This commit is contained in:
Ehouarn
2025-12-13 20:37:06 +01:00
parent bac9ed2353
commit a92afab956
15 changed files with 113 additions and 36 deletions

View File

@@ -777,11 +777,13 @@ class OrderCreateView(ProtectQuerysetMixin, ProtectedCreateView):
activity = Activity.objects.get(pk=self.kwargs["activity_pk"])
form.instance.activity = activity
supplements = Supplement.objects.filter(pk__in=form.data.getlist('supplements')).all()
return super().form_valid(form)
form.instance.save(supplements=supplements)
return HttpResponseRedirect(self.get_success_url())
def get_success_url(self):
return reverse_lazy('food:food_list')
return reverse_lazy('food:dish_list', kwargs={"activity_pk": self.kwargs["activity_pk"]})
class OrderListView(ProtectQuerysetMixin, LoginRequiredMixin, MultiTableMixin, ListView):