manager: do not display cancel link when event is cancelled (#47000)
This commit is contained in:
parent
52b48d6b78
commit
f06b378038
|
@ -30,7 +30,9 @@
|
|||
<span class="actions">
|
||||
{% if user_can_manage %}
|
||||
<a rel="popup" href="{% url 'chrono-manager-event-delete' pk=object.agenda.id event_pk=object.id %}">{% trans 'Delete' %}</a>
|
||||
<a rel="popup" class="link-action-text cancel" href="{% url 'chrono-manager-event-cancel' pk=agenda.pk event_pk=event.pk %}?next={{ request.path }}">{% trans "Cancel" %}</a>
|
||||
{% if not event.cancellation_status %}
|
||||
<a rel="popup" href="{% url 'chrono-manager-event-cancel' pk=agenda.pk event_pk=event.pk %}?next={{ request.path }}">{% trans "Cancel" %}</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'chrono-manager-event-edit' pk=agenda.id event_pk=object.id %}">{% trans "Options" %}</a>
|
||||
{% endif %}
|
||||
</span>
|
||||
|
|
|
@ -3835,10 +3835,10 @@ def test_event_cancellation(app, admin_user):
|
|||
assert '0/10 bookings' in resp.text
|
||||
|
||||
resp = resp.click('Cancel', href='/cancel')
|
||||
assert not 'related bookings' in resp.text
|
||||
assert 'related bookings' not in resp.text
|
||||
|
||||
booking = Booking.objects.create(event=event)
|
||||
booking2 = Booking.objects.create(event=event)
|
||||
Booking.objects.create(event=event)
|
||||
Booking.objects.create(event=event)
|
||||
|
||||
resp = app.get('/manage/agendas/%s/%d/%d/' % (agenda.id, day.year, day.month))
|
||||
assert '2/10 bookings' in resp.text
|
||||
|
@ -3850,6 +3850,8 @@ def test_event_cancellation(app, admin_user):
|
|||
assert 'Cancelled' in resp.text
|
||||
assert '0/10 bookings' in resp.text
|
||||
assert Booking.objects.filter(event=event, cancellation_datetime__isnull=False).count() == 2
|
||||
resp = app.get('/manage/agendas/%d/events/%d/' % (agenda.pk, event.pk))
|
||||
assert '/manage/agendas/%d/events/%d/cancel' % (agenda.pk, event.pk) not in resp.text
|
||||
|
||||
|
||||
def test_event_cancellation_error_report(app, admin_user):
|
||||
|
|
Loading…
Reference in New Issue