Prevent checking in to cancelled events and dry hires

Will close #539
This commit is contained in:
2023-05-22 11:19:08 +01:00
parent 90ae87b1b2
commit a3458cea3d
6 changed files with 6 additions and 6 deletions

View File

@@ -497,7 +497,7 @@ class Event(models.Model, RevisionMixin):
earliest = datetime.datetime.combine(self.start_date, datetime.time(00, 00))
tz = pytz.timezone(settings.TIME_ZONE)
earliest = tz.localize(earliest)
return not self.dry_hire and earliest <= timezone.now()
return not self.dry_hire and not self.status == Event.CANCELLED and earliest <= timezone.now()
objects = EventManager()

View File

@@ -209,7 +209,7 @@
<div class="col-sm-9 col-md-7 col-lg-8">
<select id="{{ form.venue.id_for_label }}" name="{{ form.venue.name }}" class="selectpicker" data-live-search="true" data-sourceurl="{% url 'api_secure' model='venue' %}">
{% if venue %}
<option value="{{venue.value}}" selected="selected" data-update_url="{% url 'venue_update' venue.value %}">{{ venue }}</option>
<option value="{{venue.id}}" selected="selected" data-update_url="{% url 'venue_update' venue.id %}">{{ venue }}</option>
{% endif %}
</select>
</div>