Compare commits

..
Author SHA1 Message Date
Raphael Michel 368f9f768d Event list: Reduce disk load of SQL query 2026-08-28 18:15:44 +02:00
4 changed files with 18 additions and 30 deletions
+2 -19
View File
@@ -123,24 +123,7 @@ jobs:
working-directory: ./src
run: make all compress
- name: Install Playwright browsers
run: playwright install --with-deps
run: playwright install
- name: Run E2E tests
working-directory: ./src
run: PRETIX_CONFIG_FILE=tests/ci_postgres.cfg py.test tests/e2e/ -v --maxfail=10 --tracing=retain-on-failure
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-traces
path: test-results/
- name: Log trace instructions
if: steps.check-traces.outputs.found == 'true'
run: |
{
echo "## 🎭 Playwright traces available"
echo ""
echo "Some tests failed or retried and produced traces."
echo ""
echo "1. Download the **playwright-traces-${{ github.run_id }}** artifact from this run (link in the **Summary** tab, under Artifacts)."
echo "2. Unzip it."
echo "3. Go to https://trace.playwright.dev and drag \`trace.zip\` into the page — or run \`npx playwright show-trace trace.zip\` locally."
} >> "$GITHUB_STEP_SUMMARY"
run: PRETIX_CONFIG_FILE=tests/ci_postgres.cfg py.test tests/e2e/ -v --maxfail=10
+1 -1
View File
@@ -96,7 +96,7 @@ dependencies = [
"requests==2.34.*",
"sentry-sdk==2.68.*",
"sepaxml==2.7.*",
"stripe==15.6.*",
"stripe==7.9.*",
"text-unidecode==1.*",
"tlds>=2026072401",
"tqdm==4.*",
+1 -1
View File
@@ -334,7 +334,7 @@ class ResetPasswordForm(forms.Form):
def clean_email(self):
if 'email' not in self.cleaned_data:
return
if rate_limit("customer_pwreset_check", include_ip_from_request=self.request, max_num=10, expire_time=600):
if rate_limit("customer_pwreset_check", max_num=10, expire_time=600):
raise forms.ValidationError(
self.error_messages['rate_limit'],
code='rate_limit',
+14 -9
View File
@@ -46,7 +46,7 @@ import isoweek
from django.conf import settings
from django.core.cache import caches
from django.db.models import (
Case, Exists, F, Max, Min, OuterRef, Prefetch, Q, Value, When,
Case, Exists, F, Max, Min, OuterRef, Prefetch, Q, Subquery, Value, When,
)
from django.db.models.functions import Coalesce, Greatest
from django.dispatch.dispatcher import NO_RECEIVERS
@@ -189,22 +189,27 @@ class EventListMixin:
def _get_event_list_queryset(self):
query = Q(is_public=True) & Q(live=True)
qs = self.request.organizer.events.using(settings.DATABASE_REPLICA).filter(query)
qs = qs.filter(Q(all_sales_channels=True) | Q(limit_sales_channels=self.request.sales_channel))
qs = qs.filter(Q(all_sales_channels=True) | Q(id__in=self.request.sales_channel.event_set.values_list("pk")))
show_old = "old" in self.request.GET
subevent_filter = Q(subevents__active=True, subevents__is_public=True)
subevent_filter = Q(active=True, is_public=True)
if not show_old:
subevent_filter &= Q(
Q(subevents__date_to__gte=now()) | Q(subevents__date_from__gte=now())
Q(date_to__gte=now()) | Q(date_from__gte=now())
)
subevent_subquery_qs = SubEvent.objects.with_scopes_disabled().filter(
subevent_filter,
event_id=OuterRef('pk')
).values('event').order_by()
qs = qs.annotate(
min_from=Min('subevents__date_from', filter=subevent_filter),
min_to=Min('subevents__date_to', filter=subevent_filter),
max_from=Max('subevents__date_from', filter=subevent_filter),
max_to=Max('subevents__date_to', filter=subevent_filter),
max_fromto=Greatest(Max('subevents__date_to', filter=subevent_filter), Max('subevents__date_from', filter=subevent_filter)),
min_from=Subquery(subevent_subquery_qs.annotate(m=Min('date_from')).values('m')),
min_to=Subquery(subevent_subquery_qs.annotate(m=Min('date_to')).values('m')),
max_from=Subquery(subevent_subquery_qs.annotate(m=Max('date_from')).values('m')),
max_to=Subquery(subevent_subquery_qs.annotate(m=Max('date_to')).values('m')),
).annotate(
max_fromto=Greatest(F("max_to"), F("max_from")),
)
if show_old:
date_q = Q(date_to__lt=now()) | (Q(date_to__isnull=True) & Q(date_from__lt=now()))