Compare commits

...
Author SHA1 Message Date
Raphael Michel a98755bd24 Item form: Prevent combining validity_mode with gift cards 2024-05-31 19:50:47 +02:00
Raphael Michel 8010d2e6bb Update GitLab CI script 2024-05-31 17:46:45 +02:00
Raphael Michel 1566f54764 VAT ID validation: Fix crash with invalid Norwegian IDs (PRETIXEU-A3J) 2024-05-29 09:31:58 +02:00
Richard SchreiberandGitHub 9d380557e1 SEO improvements - add h1.sr-only if only header-image is used
* add hidden h1 with event-title if header-image only

* add event-title to alt-attribute of header-image

* add hidden setting for google_site_verification
2024-05-28 09:18:15 +02:00
6 changed files with 51 additions and 19 deletions
+16 -16
View File
@@ -1,29 +1,30 @@
before_script:
tests:
image:
name: pretix/ci-image
stage: test
before_script:
- pip install -U pip uv
- uv pip install --system -U wheel setuptools
script:
- virtualenv env
- source env/bin/activate
- pip install -U pip wheel setuptools
- XDG_CACHE_HOME=/cache pip3 install -e ".[dev]"
- uv pip install --system -e ".[dev]"
- cd src
- python manage.py check
- make all compress
- py.test --reruns 3 -n 3 tests
tags:
- python3
- PRETIX_CONFIG_FILE=tests/travis_sqlite.cfg py.test --reruns 3 -n 3 tests --maxfail=100
except:
- pypi
pypi:
stage: release
image:
name: pretix/ci-image
before_script:
- cat $PYPIRC > ~/.pypirc
- pip install -U pip uv
- uv pip install --system -U wheel setuptools twine build pretix-plugin-build check-manifest
script:
- cp /keys/.pypirc ~/.pypirc
- virtualenv env
- source env/bin/activate
- pip install -U pip wheel setuptools check-manifest twine
- XDG_CACHE_HOME=/cache pip3 install -e ".[dev]"
- uv pip install --system -e ".[dev]"
- python setup.py sdist
- pip install dist/pretix-*.tar.gz
- uv pip install --system dist/pretix-*.tar.gz
- python -m pretix migrate
- python -m pretix check
- cd src
@@ -33,13 +34,12 @@ pypi:
- python -m build
- twine check dist/*
- twine upload dist/*
tags:
- python3
only:
- pypi
artifacts:
paths:
- src/dist/
stages:
- test
- build
+4 -1
View File
@@ -62,7 +62,10 @@ class VATIDTemporaryError(VATIDError):
def _validate_vat_id_NO(vat_id, country_code):
# Inspired by vat_moss library
vat_id = vat_moss.id.normalize(vat_id)
try:
vat_id = vat_moss.id.normalize(vat_id)
except ValueError:
raise VATIDFinalError(error_messages['invalid'])
if not vat_id or len(vat_id) < 3 or not re.match('^\\d{9}MVA$', vat_id[2:]):
raise VATIDFinalError(error_messages['invalid'])
+8
View File
@@ -698,6 +698,14 @@ class ItemUpdateForm(I18nModelForm):
'tax_rule',
_("Gift card products should use a tax rule with a rate of 0 percent since sales tax will be applied when the gift card is redeemed.")
)
if d.get('validity_mode'):
self.add_error(
'validity_mode',
_(
"Do not set a specific validity for gift card products as it will not restrict the validity "
"of the gift card. A validity of gift cards can be set in your organizer settings."
)
)
if d.get('admission'):
self.add_error(
'admission',
@@ -19,6 +19,9 @@
{% if social_image %}
<meta property="og:image" content="{{ social_image }}" />
{% endif %}
{% if event.settings.google_site_verification %}
<meta name="google-site-verification" content="{{ event.settings.google_site_verification }}" />
{% endif %}
{{ block.super }}
{% endblock %}
{% block above %}
@@ -68,15 +71,23 @@
{% block page %}
<div class="page-header{% if event_logo %} pager-header-with-logo{% endif %}{% if event_logo and event_logo_image_large %} logo-large{% endif %}">
<div class="{% if not event_logo or not event_logo_image_large %}pull-left flip{% endif %}">
{% if event_logo and not event_logo_show_title %}
<h1 class="sr-only">
{{ event.name }}
{% if request.event.settings.show_dates_on_frontpage and not event.has_subevents %}
<small>{{ event.get_date_range_display_as_html }}</small>
{% endif %}
</h1>
{% endif %}
{% if event_logo and event_logo_image_large %}
<a href="{% eventurl event "presale:event.index" cart_namespace=cart_namespace|default_if_none:"" %}"
aria-label="{% trans 'Homepage' %}" title="{% trans 'Homepage' %}">
<img src="{{ event_logo|thumb:'1170x5000' }}" alt="" class="event-logo" />
<img src="{{ event_logo|thumb:'1170x5000' }}" alt="{{ event.name }}" class="event-logo" />
</a>
{% elif event_logo %}
<a href="{% eventurl event "presale:event.index" cart_namespace=cart_namespace|default_if_none:"" %}"
aria-label="{% trans 'Homepage' %}" title="{% trans 'Homepage' %}">
<img src="{{ event_logo|thumb:'5000x120' }}" alt="" class="event-logo" />
<img src="{{ event_logo|thumb:'5000x120' }}" alt="{{ event.name }}" class="event-logo" />
</a>
{% else %}
<h1>
@@ -12,6 +12,10 @@
<meta name="robots" content="noindex, nofollow">
{% endif %}
<meta property="og:type" content="website" />
{% if organizer.settings.google_site_verification %}
<meta name="google-site-verification" content="{{ organizer.settings.google_site_verification }}" />
{% endif %}
{{ block.super }}
{% endblock %}
{% block above %}
@@ -39,6 +43,11 @@
{% block page %}
<div class="page-header{% if organizer_logo %} pager-header-with-logo{% endif %}{% if organizer_logo and organizer.settings.organizer_logo_image_large %} logo-large{% endif %}">
<div class="{% if not organizer_logo or not organizer.settings.organizer_logo_image_large %}pull-left flip{% endif %}">
{% if organizer_logo %}
<h1 class="sr-only">
{{ organizer.name }}
</h1>
{% endif %}
{% if organizer_logo and organizer.settings.organizer_logo_image_large %}
<a href="{% eventurl organizer "presale:organizer.index" %}" title="{{ organizer.name }}">
<img src="{{ organizer_logo|thumb:'1170x5000' }}" alt="{{ organizer.name }}"
+1
View File
@@ -20,6 +20,7 @@ DJANGO_SETTINGS_MODULE = tests.settings
addopts = --reruns 3 -rw
filterwarnings =
error
ignore:.*invalid escape sequence.*:
ignore:The 'warn' method is deprecated:DeprecationWarning
ignore::django.utils.deprecation.RemovedInDjango51Warning:django.core.files.storage
ignore:.*index_together.*:django.utils.deprecation.RemovedInDjango51Warning: