Commit 18b00f36 authored by Hayat's avatar Hayat
Browse files

Merge branch 'fix-booked-timeslot' into 'master'

Fix booked timeslot

See merge request !6
parents 4c6aff19 020f3461
Pipeline #7751 passed with stages
in 4 minutes and 2 seconds
......@@ -9,7 +9,7 @@
<form method="post">
{% csrf_token %}
{% bootstrap_form_errors form type='non_fields' %}
{% bootstrap_form_errors form %}
<p>{% translate 'Please select one of the available timeslots to make an appointment. You will still be able to change your selection later.' %}</p>
<table class="table table-hover" data-js="multi-datetime">
......
......@@ -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