Compare commits

..
3 changed files with 67 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -19,4 +19,4 @@
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>.
#
__version__ = "2026.10.0"
__version__ = "2027.1.0.dev0"
@@ -0,0 +1,58 @@
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-today pretix GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation in version 3 of the License.
#
# ADDITIONAL TERMS APPLY: Pursuant to Section 7 of the GNU Affero General Public License, additional terms are
# applicable granting you additional permissions and placing additional restrictions on your usage of this software.
# Please refer to the pretix LICENSE file to obtain the full terms applicable to this work. If you did not receive
# this file, see <https://pretix.eu/about/en/license>.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>.
#
import sys
import traceback
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils import translation
from django_countries import Countries
class Command(BaseCommand):
help = "Check all translations are loadable"
def handle(self, *args, **options):
# We often experience crashes because somewhere in some plugin an invalid .po file hides, e.g. with an invalid
# plural form. This can sometimes only become visible in a combination of language and country, so we test all
# combinations.
def excepthook(type, value, tb):
traceback.print_exception(type, value, tb)
while tb.tb_next:
if "mofile" in tb.tb_frame.f_locals:
print("Error found in file", tb.tb_frame.f_locals["mofile"])
break
tb = tb.tb_next
sys.excepthook = excepthook
country_codes = [cc for cc, cntry in Countries()]
for lang, name in settings.LANGUAGES:
if '-' not in lang:
for c in country_codes:
translation.activate(lang + '-' + c)
translation.gettext("Order")
else:
translation.activate(lang)
translation.gettext("Order")
+8 -1
View File
@@ -37,6 +37,7 @@ import uuid
from collections import defaultdict
from datetime import time
from decimal import Decimal
from urllib.parse import urlencode
from django import forms
from django.conf import settings
@@ -686,7 +687,13 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
if 'async_id' in request.GET and settings.HAS_CELERY:
return self.get_result(request)
if len(self.forms) == 0 and len(self.cross_selling_data) == 0 and self.is_completed(request):
return redirect(self.get_prev_url(request) if request.GET.get('dir') == 'prev' else self.get_next_url(request))
if request.GET.get('dir') == 'prev':
url = redirect(self.get_prev_url(request))
else:
url = self.get_next_url(request)
params = {k: v for k, v in self.request.GET.items() if k in ("gclid", "_gl") or k.startswith("utm_")}
url += ('&' if '?' in url else '?') + urlencode(params)
return redirect(url)
return TemplateFlowStep.get(self, request)
def _clean_category(self, form, category):