chore: update for pretalx 2024.1.0
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Luca 2024-02-16 19:11:14 +01:00
parent 353213b1c8
commit 83409ef2c8
4 changed files with 22 additions and 10 deletions

View File

@ -1 +1 @@
__version__ = "0.14.3" __version__ = "0.15.0"

View File

@ -83,3 +83,10 @@ class AssigneeForm(forms.ModelForm):
class EnhancedSubmissionFilterForm(SubmissionFilterForm): class EnhancedSubmissionFilterForm(SubmissionFilterForm):
require_all_tags = forms.BooleanField(required=False, label=_("require all")) require_all_tags = forms.BooleanField(required=False, label=_("require all"))
def filter_queryset(self, qs):
qs = super().filter_queryset(qs)
if self.cleaned_data.get("require_all_tags"):
for tag in self.cleaned_data.get("tags"):
qs = qs.filter(tags__in=[tag])
return qs

View File

@ -29,7 +29,7 @@
<div class="submit-group search-submit-group"> <div class="submit-group search-submit-group">
<form class="search-form"> <form class="search-form">
{% bootstrap_form search_form %} {% bootstrap_field filter_form.q %}
{% if show_submission_types and filter_form.submission_type %}{% bootstrap_field filter_form.submission_type %}{% endif %} {% if show_submission_types and filter_form.submission_type %}{% bootstrap_field filter_form.submission_type %}{% endif %}
<div class="d-flex flex-column form-group"> <div class="d-flex flex-column form-group">
{% bootstrap_field filter_form.state layout='inline' %} {% bootstrap_field filter_form.state layout='inline' %}
@ -150,5 +150,5 @@
</table> </table>
</div> </div>
{% include "orga/pagination.html" %} {% include "orga/includes/pagination.html" %}
{% endblock %} {% endblock %}

View File

@ -15,7 +15,7 @@ from django.views.generic import FormView, TemplateView, View
from django.views.generic.detail import SingleObjectMixin from django.views.generic.detail import SingleObjectMixin
from django_context_decorator import context from django_context_decorator import context
from pretalx.common.mixins.views import EventPermissionRequired from pretalx.common.mixins.views import EventPermissionRequired
from pretalx.orga.views.submission import SubmissionList from pretalx.orga.views.submission import BaseSubmissionList, SubmissionList
from pretalx.submission.models import Submission from pretalx.submission.models import Submission
from .forms import ( from .forms import (
@ -488,11 +488,16 @@ class EnhancedSubmissionList(SubmissionList):
event=self.request.event, event=self.request.event,
usable_states=self.usable_states, usable_states=self.usable_states,
limit_tracks=self.limit_tracks, limit_tracks=self.limit_tracks,
search_fields=self.get_default_filters(),
) )
def filter_queryset(self, qs): def _get_base_queryset(self, for_review=False):
qs = super().filter_queryset(qs.prefetch_related("assignee")) qs = (
if self.request.GET.get("require_all_tags", "") == "on": super(BaseSubmissionList, self)
for tag in self.request.GET.getlist("tags"): .get_queryset(for_review=for_review)
qs = qs.filter(tags__in=[tag]) .prefetch_related("assignee")
.order_by("-id")
)
if not self.filter_form.is_valid():
return qs return qs
return self.filter_form.filter_queryset(qs)