chore: update for pretalx 2024.1.0
This commit is contained in:
parent
353213b1c8
commit
83409ef2c8
|
@ -1 +1 @@
|
|||
__version__ = "0.14.3"
|
||||
__version__ = "0.15.0"
|
||||
|
|
|
@ -83,3 +83,10 @@ class AssigneeForm(forms.ModelForm):
|
|||
|
||||
class EnhancedSubmissionFilterForm(SubmissionFilterForm):
|
||||
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
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<div class="submit-group search-submit-group">
|
||||
<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 %}
|
||||
<div class="d-flex flex-column form-group">
|
||||
{% bootstrap_field filter_form.state layout='inline' %}
|
||||
|
@ -150,5 +150,5 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
{% include "orga/pagination.html" %}
|
||||
{% include "orga/includes/pagination.html" %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -15,7 +15,7 @@ from django.views.generic import FormView, TemplateView, View
|
|||
from django.views.generic.detail import SingleObjectMixin
|
||||
from django_context_decorator import context
|
||||
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 .forms import (
|
||||
|
@ -488,11 +488,16 @@ class EnhancedSubmissionList(SubmissionList):
|
|||
event=self.request.event,
|
||||
usable_states=self.usable_states,
|
||||
limit_tracks=self.limit_tracks,
|
||||
search_fields=self.get_default_filters(),
|
||||
)
|
||||
|
||||
def filter_queryset(self, qs):
|
||||
qs = super().filter_queryset(qs.prefetch_related("assignee"))
|
||||
if self.request.GET.get("require_all_tags", "") == "on":
|
||||
for tag in self.request.GET.getlist("tags"):
|
||||
qs = qs.filter(tags__in=[tag])
|
||||
def _get_base_queryset(self, for_review=False):
|
||||
qs = (
|
||||
super(BaseSubmissionList, self)
|
||||
.get_queryset(for_review=for_review)
|
||||
.prefetch_related("assignee")
|
||||
.order_by("-id")
|
||||
)
|
||||
if not self.filter_form.is_valid():
|
||||
return qs
|
||||
return self.filter_form.filter_queryset(qs)
|
||||
|
|
Loading…
Reference in New Issue