Commit 0752efab authored by Bram in 't Zandt's avatar Bram in 't Zandt

Merge branch 'fix/events-participants-queue' into 'master'

Fix events table values in admin

See merge request !598
parents d8ba787b d0321a6e
This diff was suppressed by a .gitattributes entry.
......@@ -301,7 +301,7 @@ msgstr "Niet betaald"
#: models.py:266
msgid "Paid with cash"
msgstr "Contact betaald"
msgstr "Contant betaald"
#: models.py:267
msgid "Paid with card"
......@@ -504,7 +504,7 @@ msgstr "niet betaald"
#: templates/events/admin/registrations_table.html:13
msgid "paid cash"
msgstr "contact betaald"
msgstr "contant betaald"
#: templates/events/admin/registrations_table.html:14
msgid "paid card"
......
......@@ -161,11 +161,15 @@ class Event(models.Model, metaclass=ModelTranslateMeta):
@property
def participants(self):
return self.registrations.order_by('date')[:self.max_participants]
if self.max_participants is not None:
return self.registrations.order_by('date')[:self.max_participants]
return self.registrations.order_by('date')
@property
def queue(self):
return self.registrations.order_by('date')[self.max_participants:]
if self.max_participants is not None:
return self.registrations.order_by('date')[self.max_participants:]
return []
@property
def cancellations(self):
......
......@@ -35,9 +35,9 @@
<div class="module">
{% with event.registrationinformationfield_set.all as fields %}
<h2>{% trans "registrations"|capfirst %}</h2>
{% include 'events/admin/registrations_table.html' with registrations=event.registrations %}
{% include 'events/admin/registrations_table.html' with registrations=event.participants %}
<br>
{% if waiting %}
{% if event.queue.count > 0 %}
<h2>{% trans "waiting"|capfirst %}</h2>
{% trans "queued" as queued %}
{% include 'events/admin/registrations_table.html' with registrations=event.queue verb=queued addlink=False %}
......@@ -87,7 +87,7 @@
{% endif %}
<dt>{% trans "number of registrations"|capfirst %}</dt>
<dd>
{% blocktrans count counter=registrations|length trimmed %}
{% blocktrans count counter=event.registrations|length trimmed %}
{{ counter }} registration
{% plural %}
{{ counter }} registrations
......
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