diff --git a/chrono/agendas/models.py b/chrono/agendas/models.py index 67c0217a..82e91f03 100644 --- a/chrono/agendas/models.py +++ b/chrono/agendas/models.py @@ -2195,6 +2195,18 @@ class Booking(models.Model): self.secondary_booking_set.update(in_waiting_list=True) self.save() + def reset_user_was_present(self): + self.user_check_type_slug = None + self.user_check_type_label = None + self.user_was_present = None + with transaction.atomic(): + self.secondary_booking_set.update(user_check_type_slug=None) + self.secondary_booking_set.update(user_check_type_label=None) + self.secondary_booking_set.update(user_was_present=None) + self.save() + self.event.checked = False + self.event.save(update_fields=['checked']) + def mark_user_absence(self, check_type_slug=None, check_type_label=None): self.user_check_type_slug = check_type_slug self.user_check_type_label = check_type_label diff --git a/chrono/manager/static/js/chrono_events.manager.js b/chrono/manager/static/js/chrono_events.manager.js index 8350c9f0..2d69e3b6 100644 --- a/chrono/manager/static/js/chrono_events.manager.js +++ b/chrono/manager/static/js/chrono_events.manager.js @@ -47,6 +47,8 @@ $(function() { $form.parent().parent().html(html); if (!$('.booking-status.without-status').length) { $('tr.booking.all-bookings').hide(); + } else { + $('tr.booking.all-bookings').show(); } }).fail(function() { location.reload(); diff --git a/chrono/manager/templates/chrono/manager_event_check_booking_fragment.html b/chrono/manager/templates/chrono/manager_event_check_booking_fragment.html index 99ed8a73..2ad1d270 100644 --- a/chrono/manager/templates/chrono/manager_event_check_booking_fragment.html +++ b/chrono/manager/templates/chrono/manager_event_check_booking_fragment.html @@ -1,7 +1,7 @@ {% load i18n %}