Commit 020f3461 authored by Bengfort's avatar Bengfort
Browse files

exclude booked timeslots in invitation form

parent 9ef9109d
Pipeline #7740 passed with stages
in 2 minutes and 48 seconds
......@@ -21,6 +21,7 @@ from collections import OrderedDict
from django.conf import settings
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from django.db import models
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.http import JsonResponse
......@@ -89,7 +90,9 @@ class InvitationUpdateView(UpdateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
timeslots = list(self.object.schedule.timeslot_set.all())
timeslots = list(self.object.schedule.timeslot_set.filter(
models.Q(invitation=None) | models.Q(invitation=self.object)
))
dates = []
times = []
......
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