Waitinglist: fix batch selection, add event.slug to download-filename (#2116)

* fix missing id in inputs for batch delete

* add event.slug to filename
This commit is contained in:
Richard Schreiber
2021-06-09 13:21:02 +02:00
committed by GitHub
parent b1dee5ae7c
commit fccd119a1f
2 changed files with 5 additions and 2 deletions

View File

@@ -174,7 +174,7 @@
<tr>
<td>
{% if "can_change_orders" in request.eventpermset %}
<label aria-label="{% trans "select row for batch-operation" %}" class="batch-select-label"><input type="checkbox" name="entry" class="batch-select-checkbox" value="{{ s.pk }}"/></label>
<label aria-label="{% trans "select row for batch-operation" %}" class="batch-select-label"><input type="checkbox" name="entry" class="batch-select-checkbox" value="{{ e.pk }}"/></label>
{% endif %}
</td>
{% if request.event.settings.waiting_list_names_asked %}

View File

@@ -312,9 +312,12 @@ class WaitingListView(EventPermissionRequiredMixin, WaitingListQuerySetMixin, Pa
writer.writerow(row)
r = HttpResponse(output.getvalue().encode("utf-8"), content_type='text/csv')
r['Content-Disposition'] = 'attachment; filename="waitinglist.csv"'
r['Content-Disposition'] = 'attachment; filename="{}.csv"'.format(self.get_filename())
return r
def get_filename(self):
return '{}_waitinglist'.format(self.request.event.slug)
class EntryDelete(EventPermissionRequiredMixin, DeleteView):
model = WaitingListEntry