Compare commits

...

4 Commits

Author SHA1 Message Date
Richard Schreiber
e70a903875 fix flake8 2025-03-12 12:26:30 +01:00
Richard Schreiber
fa0aa71c5c Fix race-condition when creating a customer 2025-03-12 12:23:04 +01:00
Richard Schreiber
032be74d77 Add min/max-limit on giftcard_expiry_years 2025-03-12 08:54:40 +01:00
Raphael Michel
e2e811ea47 Search engines: Do not index event lists for specific dates (#23185037) (#4901) 2025-03-11 16:09:40 +01:00
4 changed files with 19 additions and 10 deletions

View File

@@ -3291,6 +3291,8 @@ Your {organizer} team""")) # noqa: W291
label=_('Validity of gift card codes in years'),
help_text=_('If you set a number here, gift cards will by default expire at the end of the year after this '
'many years. If you keep it empty, gift cards do not have an explicit expiry date.'),
min_value=0,
max_value=99,
)
},
'cookie_consent': {

View File

@@ -257,18 +257,21 @@ class RegistrationForm(forms.Form):
return self.cleaned_data
def create(self):
customer = self.request.organizer.customers.create(
customer, created = self.request.organizer.customers.get_or_create(
email=self.cleaned_data['email'],
name_parts=self.cleaned_data['name_parts'],
phone=self.cleaned_data.get('phone'),
is_active=True,
is_verified=False,
locale=get_language_without_region(),
defaults={
"name_parts": self.cleaned_data['name_parts'],
"phone": self.cleaned_data.get('phone'),
"is_active": True,
"is_verified": False,
"locale": get_language_without_region(),
}
)
customer.set_unusable_password()
customer.save()
customer.log_action('pretix.customer.created', {})
customer.send_activation_mail()
if created:
customer.set_unusable_password()
customer.save()
customer.log_action('pretix.customer.created', {})
customer.send_activation_mail()
return customer

View File

@@ -15,6 +15,8 @@
{% block custom_header %}
{% if event.settings.meta_noindex %}
<meta name="robots" content="noindex, nofollow">
{% elif "date" in request.GET or "old" in request.GET %}
<meta name="robots" content="noindex, follow">
{% endif %}
<meta property="og:type" content="website" />
{% if social_image %}

View File

@@ -11,6 +11,8 @@
{% block custom_header %}
{% if organizer.settings.meta_noindex %}
<meta name="robots" content="noindex, nofollow">
{% elif "date" in request.GET or "old" in request.GET %}
<meta name="robots" content="noindex, follow">
{% endif %}
<meta property="og:type" content="website" />