Remove mark all present feature from events

parent a303a39c
...@@ -226,10 +226,6 @@ class EventAdmin(DoNextTranslatedModelAdmin): ...@@ -226,10 +226,6 @@ class EventAdmin(DoNextTranslatedModelAdmin):
self.admin_site.admin_view( self.admin_site.admin_view(
admin_views.EventRegistrationEmailsExport.as_view()), admin_views.EventRegistrationEmailsExport.as_view()),
name='events_event_export_email'), name='events_event_export_email'),
path('<int:pk>/all-present/',
self.admin_site.admin_view(
admin_views.EventRegistrationsMarkPresent.as_view()),
name='events_event_all_present'),
path('<int:pk>/message/', path('<int:pk>/message/',
self.admin_site.admin_view( self.admin_site.admin_view(
admin_views.EventMessage.as_view(admin=self)), admin_views.EventMessage.as_view(admin=self)),
......
...@@ -293,37 +293,3 @@ class EventRegistrationEmailsExport(TemplateView, PermissionRequiredMixin): ...@@ -293,37 +293,3 @@ class EventRegistrationEmailsExport(TemplateView, PermissionRequiredMixin):
context['addresses'] = addresses context['addresses'] = addresses
context['no_addresses'] = no_addresses context['no_addresses'] = no_addresses
return context return context
@method_decorator(staff_member_required, name='dispatch')
@method_decorator(organiser_only, name='dispatch')
class EventRegistrationsMarkPresent(View, PermissionRequiredMixin):
"""
Renders a page that outputs all email addresses of registered members
for an event
"""
template_name = 'events/admin/email_export.html'
permission_required = 'events.change_registration'
def get(self, request, pk):
"""
Mark all registrations of an event as present
:param request: the request object
:param pk: the primary key of the event
:return: HttpResponse 302 to the event admin page
"""
event = get_object_or_404(Event, pk=pk)
if event.max_participants is None:
registrations_query = event.registration_set.filter(
date_cancelled=None)
else:
registrations_query = (event.registration_set
.filter(date_cancelled=None)
.order_by('date')[:event.max_participants])
event.registration_set.filter(pk__in=registrations_query).update(
present=True, payment=Registration.PAYMENT_CASH)
return redirect('admin:events_event_details', event.pk)
This diff was suppressed by a .gitattributes entry.
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-07 19:56+0200\n" "POT-Creation-Date: 2019-08-14 08:06+0200\n"
"PO-Revision-Date: 2019-08-07 19:57+0200\n" "PO-Revision-Date: 2019-08-07 19:57+0200\n"
"Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n" "Last-Translator: Thom Wiggers <thom@thomwiggers.nl>\n"
"Language-Team: \n" "Language-Team: \n"
...@@ -487,10 +487,6 @@ msgstr "Exporteer aanmeldingen" ...@@ -487,10 +487,6 @@ msgstr "Exporteer aanmeldingen"
msgid "Export email addresses of attendees" msgid "Export email addresses of attendees"
msgstr "Exporteer e-mailadressen van aanwezigen" msgstr "Exporteer e-mailadressen van aanwezigen"
#: templates/events/admin/details.html
msgid "Set all registered to paid and present"
msgstr "Zet iedereen op betaald en present"
#: templates/events/admin/details.html #: templates/events/admin/details.html
msgid "Send pushnotification to registered users" msgid "Send pushnotification to registered users"
msgstr "Stuur pushnotificatie naar participerende gebruikers" msgstr "Stuur pushnotificatie naar participerende gebruikers"
......
This diff was suppressed by a .gitattributes entry.
...@@ -54,7 +54,6 @@ ...@@ -54,7 +54,6 @@
<br> <br>
<a href="{% url 'admin:events_event_export' pk=event.pk %}" class="button">{% trans "Export registrations" %}</a> <a href="{% url 'admin:events_event_export' pk=event.pk %}" class="button">{% trans "Export registrations" %}</a>
<a href="{% url 'admin:events_event_export_email' pk=event.pk %}" class="button">{% trans "Export email addresses of attendees" %}</a> <a href="{% url 'admin:events_event_export_email' pk=event.pk %}" class="button">{% trans "Export email addresses of attendees" %}</a>
<a href="{% url 'admin:events_event_all_present' pk=event.pk %}" class="button">{% trans "Set all registered to paid and present" %}</a>
<a href="{% url 'admin:events_event_message' pk=event.pk %}" class="button">{% trans "Send pushnotification to registered users" %}</a> <a href="{% url 'admin:events_event_message' pk=event.pk %}" class="button">{% trans "Send pushnotification to registered users" %}</a>
</div> </div>
</div> </div>
......
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