From 95333c1148dbe55a774c452630d1c0a0df85b813 Mon Sep 17 00:00:00 2001 From: Mario Behling Date: Sun, 21 Jan 2024 15:46:13 +0100 Subject: [PATCH 01/10] Create dependabot.yml --- .github/dependabot.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..b104544c9 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + + +version: 2 + +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "daily" + versioning-strategy: increase + - package-ecosystem: "npm" + directory: "/src/pretix/static/npm_dir" + schedule: + interval: "daily" From 9387332aea56dfac6709e2398c42339ec1ccc865 Mon Sep 17 00:00:00 2001 From: Shivangi-ch <57783826+Shivangi-ch@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:56:56 +0530 Subject: [PATCH 02/10] Add TLS/mTLS settings for postgreSQL and Redis (#47) --- src/pretix/settings.py | 29 ++++++++++++++++++++--------- src/pretix/settings_helpers.py | 30 ++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 9 deletions(-) create mode 100644 src/pretix/settings_helpers.py diff --git a/src/pretix/settings.py b/src/pretix/settings.py index 3213182bc..4f99360b8 100644 --- a/src/pretix/settings.py +++ b/src/pretix/settings.py @@ -3,7 +3,7 @@ import os import sys from urllib.parse import urlparse - +from .settings_helpers import build_db_tls_config, build_redis_tls_config import django.conf.locale from django.utils.crypto import get_random_string from kombu import Queue @@ -83,6 +83,11 @@ db_options['charset'] = 'utf8mb4' JSON_FIELD_AVAILABLE = db_backend in ('mysql', 'postgresql') +db_tls_config = build_db_tls_config(config, db_backend) +if (db_tls_config is not None): + db_options.update(db_tls_config) + + DATABASES = { 'default': { 'ENGINE': 'django.db.backends.' + db_backend, @@ -209,22 +214,28 @@ HAS_REDIS = config.has_option('redis', 'location') if HAS_REDIS: + redis_options = { + "CLIENT_CLASS": "django_redis.client.DefaultClient", + "REDIS_CLIENT_KWARGS": {"health_check_interval": 30} + } + redis_tls_config = build_redis_tls_config(config) + if (redis_tls_config is not None): + redis_options["CONNECTION_POOL_KWARGS"] = redis_tls_config + redis_options["REDIS_CLIENT_KWARGS"].update(redis_tls_config) + + if config.has_option('redis', 'password'): + redis_options["PASSWORD"] = config.get('redis', 'password') + CACHES['redis'] = { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": config.get('redis', 'location'), - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - "REDIS_CLIENT_KWARGS": {"health_check_interval": 30} - } + "OPTIONS": redis_options } CACHES['redis_sessions'] = { "BACKEND": "django_redis.cache.RedisCache", "LOCATION": config.get('redis', 'location'), "TIMEOUT": 3600 * 24 * 30, - "OPTIONS": { - "CLIENT_CLASS": "django_redis.client.DefaultClient", - "REDIS_CLIENT_KWARGS": {"health_check_interval": 30} - } + "OPTIONS": redis_options } if not HAS_MEMCACHED: CACHES['default'] = CACHES['redis'] diff --git a/src/pretix/settings_helpers.py b/src/pretix/settings_helpers.py new file mode 100644 index 000000000..52d70a749 --- /dev/null +++ b/src/pretix/settings_helpers.py @@ -0,0 +1,30 @@ +def build_db_tls_config(config, db_backend): + db_ssl_mode = config.get("database", "sslmode", fallback="disable") + # add postgresql TLS options + if db_ssl_mode != "disable" and db_backend == "postgresql": + db_tls_config = { + "sslmode": db_ssl_mode, + "sslrootcert": config.get("database", "sslrootcert"), + } + # add postgresql mTLS options + if config.has_option("database", "sslcert"): + db_tls_config["sslcert"] = config.get("database", "sslcert") + db_tls_config["sslkey"] = config.get("database", "sslkey") + return db_tls_config + return None + + +def build_redis_tls_config(config): + redis_ssl_cert_reqs = config.get("redis", "ssl_cert_reqs", fallback="none") + # add redis tls options + if redis_ssl_cert_reqs != "none": + redis_tls_config = { + "ssl_cert_reqs": redis_ssl_cert_reqs, + "ssl_ca_certs": config.get("redis", "ssl_ca_certs"), + } + # add redis mTLS options + if config.has_option("redis", "ssl_certfile"): + redis_tls_config["ssl_keyfile"] = config.get("redis", "ssl_keyfile") + redis_tls_config["ssl_certfile"] = config.get("redis", "ssl_certfile") + return redis_tls_config + return None From 5ba97c90e04c21e14531fba5decd5f7b964f5a83 Mon Sep 17 00:00:00 2001 From: Shivangi-ch <57783826+Shivangi-ch@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:33:15 +0530 Subject: [PATCH 03/10] Removed Python 3.6, 3.7 from GitHub Action script (#51) --- .github/workflows/tests.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a99ff2d0a..3657072cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,17 +18,13 @@ jobs: name: Tests strategy: matrix: - python-version: [3.6, 3.7, 3.8] + python-version: [3.8] database: [sqlite, postgres, mysql] exclude: - database: mysql - python-version: 3.7 + python-version: 3.8 - database: sqlite - python-version: 3.7 - - database: mysql - python-version: 3.6 - - database: sqlite - python-version: 3.6 + python-version: 3.8 steps: - uses: actions/checkout@v2 - uses: getong/mariadb-action@v1.1 From 3c0c683042a352fde138da66698f3eed811f447a Mon Sep 17 00:00:00 2001 From: Shivangi-ch <57783826+Shivangi-ch@users.noreply.github.com> Date: Mon, 18 Mar 2024 14:01:34 +0530 Subject: [PATCH 04/10] Removed MariaDB/MySQL Support (#49) --- Dockerfile | 2 -- doc/admin/config.rst | 11 ++--------- src/pretix/settings.py | 25 +++++++------------------ src/requirements/mysql.txt | 2 -- src/setup.py | 1 - src/tests/travis_mysql.cfg | 7 ------- 6 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 src/requirements/mysql.txt delete mode 100644 src/tests/travis_mysql.cfg diff --git a/Dockerfile b/Dockerfile index 15f7ef07f..79698d1c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,6 @@ FROM python:3.8 RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ - default-libmysqlclient-dev \ gettext \ git \ libffi-dev \ @@ -51,7 +50,6 @@ RUN pip3 install -U \ pip3 install \ -r requirements.txt \ -r requirements/memcached.txt \ - -r requirements/mysql.txt \ gunicorn django-extensions ipython && \ rm -rf ~/.cache/pip diff --git a/doc/admin/config.rst b/doc/admin/config.rst index 78dee6580..e0d5f4da6 100644 --- a/doc/admin/config.rst +++ b/doc/admin/config.rst @@ -135,7 +135,7 @@ Database settings Example:: [database] - backend=mysql + backend=postgresql name=pretix user=pretix password=abcd @@ -143,22 +143,15 @@ Example:: port=3306 ``backend`` - One of ``mysql``, ``sqlite3``, ``oracle`` and ``postgresql``. + One of ``sqlite3``, ``oracle`` and ``postgresql``. Default: ``sqlite3``. - If you use MySQL, be sure to create your database using - ``CREATE DATABASE CHARACTER SET utf8;``. Otherwise, Unicode - support will not properly work. - ``name`` The database's name. Default: ``db.sqlite3``. ``user``, ``password``, ``host``, ``port`` Connection details for the database connection. Empty by default. -``galera`` - Indicates if the database backend is a MySQL/MariaDB Galera cluster and - turns on some optimizations/special case handlers. Default: ``False`` .. _`config-replica`: diff --git a/src/pretix/settings.py b/src/pretix/settings.py index 4f99360b8..2d06c2c94 100644 --- a/src/pretix/settings.py +++ b/src/pretix/settings.py @@ -5,6 +5,7 @@ from urllib.parse import urlparse from .settings_helpers import build_db_tls_config, build_redis_tls_config import django.conf.locale +from django.core.exceptions import ImproperlyConfigured from django.utils.crypto import get_random_string from kombu import Queue from pkg_resources import iter_entry_points @@ -71,17 +72,11 @@ db_backend = config.get('database', 'backend', fallback='sqlite3') if db_backend == 'postgresql_psycopg2': db_backend = 'postgresql' -DATABASE_IS_GALERA = config.getboolean('database', 'galera', fallback=False) -if DATABASE_IS_GALERA and 'mysql' in db_backend: - db_options = { - 'init_command': 'SET SESSION wsrep_sync_wait = 1;' - } -else: - db_options = {} +if db_backend == 'mysql': + raise ImproperlyConfigured("MySQL/MariaDB is not supported") -if 'mysql' in db_backend: - db_options['charset'] = 'utf8mb4' -JSON_FIELD_AVAILABLE = db_backend in ('mysql', 'postgresql') +JSON_FIELD_AVAILABLE = db_backend == 'postgresql' +db_options = {} db_tls_config = build_db_tls_config(config, db_backend) if (db_tls_config is not None): @@ -98,10 +93,7 @@ 'PORT': config.get('database', 'port', fallback=''), 'CONN_MAX_AGE': 0 if db_backend == 'sqlite3' else 120, 'OPTIONS': db_options, - 'TEST': { - 'CHARSET': 'utf8mb4', - 'COLLATION': 'utf8mb4_unicode_ci', - } if 'mysql' in db_backend else {} + 'TEST': {} } } DATABASE_REPLICA = 'default' @@ -116,10 +108,7 @@ 'PORT': config.get('replica', 'port', fallback=DATABASES['default']['PORT']), 'CONN_MAX_AGE': 0 if db_backend == 'sqlite3' else 120, 'OPTIONS': db_options, - 'TEST': { - 'CHARSET': 'utf8mb4', - 'COLLATION': 'utf8mb4_unicode_ci', - } if 'mysql' in db_backend else {} + 'TEST': {} } DATABASE_ROUTERS = ['pretix.helpers.database.ReplicaRouter'] diff --git a/src/requirements/mysql.txt b/src/requirements/mysql.txt deleted file mode 100644 index 93c8d852b..000000000 --- a/src/requirements/mysql.txt +++ /dev/null @@ -1,2 +0,0 @@ -mysqlclient - diff --git a/src/setup.py b/src/setup.py index 58b8854f2..6908b6222 100644 --- a/src/setup.py +++ b/src/setup.py @@ -203,7 +203,6 @@ def run(self): 'freezegun', ], 'memcached': ['pylibmc'], - 'mysql': ['mysqlclient'], }, packages=find_packages(exclude=['tests', 'tests.*']), diff --git a/src/tests/travis_mysql.cfg b/src/tests/travis_mysql.cfg deleted file mode 100644 index 48dc3133e..000000000 --- a/src/tests/travis_mysql.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[database] -backend=mysql -name=pretix -user=root -password= -host=127.0.0.1 -port=3306 From 528da501470f40dcbe41228a08d9fc337d5d49ef Mon Sep 17 00:00:00 2001 From: eMBee Date: Mon, 18 Mar 2024 18:03:17 +0300 Subject: [PATCH 05/10] update django to 3.2 (#52) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * update requirements to django 3.2 * remove jsonfallback, pull in helper functions that are still used from original jsonfallback code * fix tests for django 3.2 * keep versions in sync with requirements --------- Co-authored-by: Martin Bähr --- doc/development/setup.rst | 4 +- src/pretix/api/middleware.py | 2 +- src/pretix/base/i18n.py | 9 +-- .../migrations/0102_auto_20181017_0024.py | 9 ++- .../migrations/0103_auto_20181121_1224.py | 1 - .../migrations/0104_auto_20181114_1526.py | 1 - .../migrations/0105_auto_20190112_1512.py | 1 - .../migrations/0107_auto_20190129_1337.py | 1 - .../migrations/0108_auto_20190201_1527.py | 1 - ...01_1527_squashed_0141_seat_sorting_rank.py | 7 +-- .../migrations/0109_auto_20190208_1432.py | 1 - .../migrations/0110_auto_20190219_1245.py | 1 - .../migrations/0111_auto_20190219_0949.py | 1 - .../migrations/0113_auto_20190312_0942.py | 1 - .../migrations/0114_auto_20190316_1014.py | 1 - .../migrations/0115_auto_20190323_2238.py | 1 - .../migrations/0116_auto_20190402_0722.py | 1 - .../migrations/0118_auto_20190423_0839.py | 1 - .../migrations/0119_auto_20190509_0654.py | 1 - .../migrations/0120_auto_20190509_0736.py | 7 +-- .../migrations/0152_auto_20200511_1504.py | 3 +- .../migrations/0177_auto_20210301_1510.py | 3 +- src/pretix/base/models/checkin.py | 5 +- src/pretix/base/models/orders.py | 27 ++++---- src/pretix/base/models/waitinglist.py | 4 +- src/pretix/helpers/models.py | 3 +- src/pretix/helpers/templatetags/jsonfield.py | 61 +++++++++++++++++++ src/pretix/plugins/badges/exporters.py | 2 +- src/pretix/plugins/checkinlists/exporters.py | 3 +- .../plugins/ticketoutputpdf/exporters.py | 3 +- src/requirements/dev.txt | 4 +- src/requirements/production.txt | 22 +++---- src/setup.py | 26 ++++---- src/tests/api/test_idempotency.py | 2 +- src/tests/control/test_auth.py | 6 +- 35 files changed, 136 insertions(+), 90 deletions(-) create mode 100644 src/pretix/helpers/templatetags/jsonfield.py diff --git a/doc/development/setup.rst b/doc/development/setup.rst index d019846ff..a48be06c9 100644 --- a/doc/development/setup.rst +++ b/doc/development/setup.rst @@ -26,9 +26,11 @@ Your should install the following on your system: * ``libssl`` (Debian package: ``libssl-dev``) * ``libxml2`` (Debian package ``libxml2-dev``) * ``libxslt`` (Debian package ``libxslt1-dev``) -* ``libenchant1c2a`` (Debian package ``libenchant1c2a``) +* ``libenchant1c2a`` (Debian package ``libenchant1c2a`` or ``libenchant2-2``) * ``msgfmt`` (Debian package ``gettext``) +* ``freetype`` (Debian package ``libfreetype-dev``) * ``git`` +* for pillow: ``libjpeg`` (Debian Package ``libjpeg-dev``) Your local python environment ----------------------------- diff --git a/src/pretix/api/middleware.py b/src/pretix/api/middleware.py index fa77fba10..1179eac90 100644 --- a/src/pretix/api/middleware.py +++ b/src/pretix/api/middleware.py @@ -68,7 +68,7 @@ def __call__(self, request: HttpRequest): call.response_body = json.dumps(resp.data) else: call.response_body = repr(resp).encode() - call.response_headers = json.dumps(resp._headers) + call.response_headers = json.dumps(resp.headers._store) call.locked = None call.save(update_fields=['locked', 'response_code', 'response_headers', 'response_body']) diff --git a/src/pretix/base/i18n.py b/src/pretix/base/i18n.py index 99ba153b5..cb0be9732 100644 --- a/src/pretix/base/i18n.py +++ b/src/pretix/base/i18n.py @@ -73,10 +73,11 @@ def __str__(self): def get_babel_locale(): babel_locale = 'en' # Babel, and therefore django-phonenumberfield, do not support our custom locales such das de_Informal - if localedata.exists(translation.get_language()): - babel_locale = translation.get_language() - elif localedata.exists(translation.get_language()[:2]): - babel_locale = translation.get_language()[:2] + if translation.get_language(): + if localedata.exists(translation.get_language()): + babel_locale = translation.get_language() + elif localedata.exists(translation.get_language()[:2]): + babel_locale = translation.get_language()[:2] return babel_locale diff --git a/src/pretix/base/migrations/0102_auto_20181017_0024.py b/src/pretix/base/migrations/0102_auto_20181017_0024.py index 945ef0feb..cbab44764 100644 --- a/src/pretix/base/migrations/0102_auto_20181017_0024.py +++ b/src/pretix/base/migrations/0102_auto_20181017_0024.py @@ -1,8 +1,7 @@ # Generated by Django 2.1 on 2018-10-17 00:24 -import jsonfallback.fields from django.core.exceptions import ImproperlyConfigured -from django.db import migrations +from django.db import migrations, models from django_mysql.checks import mysql_connections from django_mysql.utils import connection_is_mariadb @@ -77,19 +76,19 @@ class Migration(migrations.Migration): migrations.AddField( model_name='cartposition', name='attendee_name_parts', - field=jsonfallback.fields.FallbackJSONField(null=False, default=dict), + field=models.JSONField(null=False, default=dict), preserve_default=False, ), migrations.AddField( model_name='orderposition', name='attendee_name_parts', - field=jsonfallback.fields.FallbackJSONField(null=False, default=dict), + field=models.JSONField(null=False, default=dict), preserve_default=False, ), migrations.AddField( model_name='invoiceaddress', name='name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), preserve_default=False, ), migrations.RunPython(set_attendee_name_parts, migrations.RunPython.noop) diff --git a/src/pretix/base/migrations/0103_auto_20181121_1224.py b/src/pretix/base/migrations/0103_auto_20181121_1224.py index 5c6b3b78e..de770832c 100644 --- a/src/pretix/base/migrations/0103_auto_20181121_1224.py +++ b/src/pretix/base/migrations/0103_auto_20181121_1224.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.1 on 2018-11-21 12:24 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0104_auto_20181114_1526.py b/src/pretix/base/migrations/0104_auto_20181114_1526.py index 31e1119b0..52241a19c 100644 --- a/src/pretix/base/migrations/0104_auto_20181114_1526.py +++ b/src/pretix/base/migrations/0104_auto_20181114_1526.py @@ -2,7 +2,6 @@ import django.db.models.deletion import django.db.models.manager -import jsonfallback.fields from django.db import migrations, models diff --git a/src/pretix/base/migrations/0105_auto_20190112_1512.py b/src/pretix/base/migrations/0105_auto_20190112_1512.py index aa5bb9010..79060a0ac 100644 --- a/src/pretix/base/migrations/0105_auto_20190112_1512.py +++ b/src/pretix/base/migrations/0105_auto_20190112_1512.py @@ -1,7 +1,6 @@ # Generated by Django 2.1 on 2019-01-12 15:12 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0107_auto_20190129_1337.py b/src/pretix/base/migrations/0107_auto_20190129_1337.py index 187fcc7f9..2ddd14660 100644 --- a/src/pretix/base/migrations/0107_auto_20190129_1337.py +++ b/src/pretix/base/migrations/0107_auto_20190129_1337.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.5 on 2019-01-29 13:37 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0108_auto_20190201_1527.py b/src/pretix/base/migrations/0108_auto_20190201_1527.py index 30dd42e7d..8edbd38f5 100644 --- a/src/pretix/base/migrations/0108_auto_20190201_1527.py +++ b/src/pretix/base/migrations/0108_auto_20190201_1527.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.5 on 2019-02-01 15:27 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0108_auto_20190201_1527_squashed_0141_seat_sorting_rank.py b/src/pretix/base/migrations/0108_auto_20190201_1527_squashed_0141_seat_sorting_rank.py index 280f9e1e0..123f0001f 100644 --- a/src/pretix/base/migrations/0108_auto_20190201_1527_squashed_0141_seat_sorting_rank.py +++ b/src/pretix/base/migrations/0108_auto_20190201_1527_squashed_0141_seat_sorting_rank.py @@ -3,7 +3,6 @@ from decimal import Decimal import django.db.models.deletion -import jsonfallback.fields from django.conf import settings from django.core.cache import cache from django.db import migrations, models @@ -190,7 +189,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='cartposition', name='attendee_name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AlterField( model_name='cartposition', @@ -210,7 +209,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='invoiceaddress', name='name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AlterField( model_name='item', @@ -225,7 +224,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='orderposition', name='attendee_name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AlterField( model_name='orderposition', diff --git a/src/pretix/base/migrations/0109_auto_20190208_1432.py b/src/pretix/base/migrations/0109_auto_20190208_1432.py index c7a491115..b72a4c961 100644 --- a/src/pretix/base/migrations/0109_auto_20190208_1432.py +++ b/src/pretix/base/migrations/0109_auto_20190208_1432.py @@ -1,7 +1,6 @@ # Generated by Django 2.1 on 2019-02-08 14:32 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0110_auto_20190219_1245.py b/src/pretix/base/migrations/0110_auto_20190219_1245.py index 92da90819..76cfd55b7 100644 --- a/src/pretix/base/migrations/0110_auto_20190219_1245.py +++ b/src/pretix/base/migrations/0110_auto_20190219_1245.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.5 on 2019-02-19 12:45 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0111_auto_20190219_0949.py b/src/pretix/base/migrations/0111_auto_20190219_0949.py index 75bea99da..ad296f456 100644 --- a/src/pretix/base/migrations/0111_auto_20190219_0949.py +++ b/src/pretix/base/migrations/0111_auto_20190219_0949.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.5 on 2019-02-19 09:49 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0113_auto_20190312_0942.py b/src/pretix/base/migrations/0113_auto_20190312_0942.py index 308c69685..4c2f5320f 100644 --- a/src/pretix/base/migrations/0113_auto_20190312_0942.py +++ b/src/pretix/base/migrations/0113_auto_20190312_0942.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.5 on 2019-03-12 09:42 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0114_auto_20190316_1014.py b/src/pretix/base/migrations/0114_auto_20190316_1014.py index b74854a62..2d81043c9 100644 --- a/src/pretix/base/migrations/0114_auto_20190316_1014.py +++ b/src/pretix/base/migrations/0114_auto_20190316_1014.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.7 on 2019-03-16 10:14 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0115_auto_20190323_2238.py b/src/pretix/base/migrations/0115_auto_20190323_2238.py index 6559ab246..72820d062 100644 --- a/src/pretix/base/migrations/0115_auto_20190323_2238.py +++ b/src/pretix/base/migrations/0115_auto_20190323_2238.py @@ -3,7 +3,6 @@ from decimal import Decimal import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0116_auto_20190402_0722.py b/src/pretix/base/migrations/0116_auto_20190402_0722.py index 7d1c5d62a..fc88c0e06 100644 --- a/src/pretix/base/migrations/0116_auto_20190402_0722.py +++ b/src/pretix/base/migrations/0116_auto_20190402_0722.py @@ -1,7 +1,6 @@ # Generated by Django 2.1.5 on 2019-04-02 07:22 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0118_auto_20190423_0839.py b/src/pretix/base/migrations/0118_auto_20190423_0839.py index 94396b97b..839a16fa0 100644 --- a/src/pretix/base/migrations/0118_auto_20190423_0839.py +++ b/src/pretix/base/migrations/0118_auto_20190423_0839.py @@ -1,7 +1,6 @@ # Generated by Django 2.2 on 2019-04-23 08:39 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0119_auto_20190509_0654.py b/src/pretix/base/migrations/0119_auto_20190509_0654.py index e16ba93f1..04246fc8e 100644 --- a/src/pretix/base/migrations/0119_auto_20190509_0654.py +++ b/src/pretix/base/migrations/0119_auto_20190509_0654.py @@ -1,7 +1,6 @@ # Generated by Django 2.2 on 2019-05-09 06:54 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields diff --git a/src/pretix/base/migrations/0120_auto_20190509_0736.py b/src/pretix/base/migrations/0120_auto_20190509_0736.py index c0904e832..17ae129ac 100644 --- a/src/pretix/base/migrations/0120_auto_20190509_0736.py +++ b/src/pretix/base/migrations/0120_auto_20190509_0736.py @@ -1,7 +1,6 @@ # Generated by Django 2.2 on 2019-05-09 07:36 import django.db.models.deletion -import jsonfallback.fields from django.db import migrations, models import pretix.base.models.fields @@ -17,7 +16,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='cartposition', name='attendee_name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AlterField( model_name='cartposition', @@ -37,7 +36,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='invoiceaddress', name='name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AlterField( model_name='item', @@ -52,7 +51,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='orderposition', name='attendee_name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AlterField( model_name='orderposition', diff --git a/src/pretix/base/migrations/0152_auto_20200511_1504.py b/src/pretix/base/migrations/0152_auto_20200511_1504.py index ee514a291..36f2e171c 100644 --- a/src/pretix/base/migrations/0152_auto_20200511_1504.py +++ b/src/pretix/base/migrations/0152_auto_20200511_1504.py @@ -2,7 +2,6 @@ import django.db.models.deletion import django_countries.fields -import jsonfallback.fields from django.db import migrations, models import pretix.helpers.countries @@ -43,7 +42,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='checkinlist', name='rules', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AlterUniqueTogether( name='checkin', diff --git a/src/pretix/base/migrations/0177_auto_20210301_1510.py b/src/pretix/base/migrations/0177_auto_20210301_1510.py index 7a2795ed2..2ed389153 100644 --- a/src/pretix/base/migrations/0177_auto_20210301_1510.py +++ b/src/pretix/base/migrations/0177_auto_20210301_1510.py @@ -1,6 +1,5 @@ # Generated by Django 3.0.10 on 2021-03-01 15:10 -import jsonfallback.fields import phonenumber_field.modelfields from django.db import migrations, models @@ -20,7 +19,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='waitinglistentry', name='name_parts', - field=jsonfallback.fields.FallbackJSONField(default=dict), + field=models.JSONField(default=dict), ), migrations.AddField( model_name='waitinglistentry', diff --git a/src/pretix/base/models/checkin.py b/src/pretix/base/models/checkin.py index 46502a1df..a162a3c84 100644 --- a/src/pretix/base/models/checkin.py +++ b/src/pretix/base/models/checkin.py @@ -1,11 +1,10 @@ from django.conf import settings from django.core.exceptions import ValidationError from django.db import models -from django.db.models import Exists, F, Max, OuterRef, Q, Subquery +from django.db.models import Exists, F, Max, OuterRef, Q, Subquery, JSONField from django.utils.timezone import now from django.utils.translation import gettext_lazy as _, pgettext_lazy from django_scopes import ScopedManager, scopes_disabled -from jsonfallback.fields import FallbackJSONField from pretix.base.models import LoggedModel from pretix.base.models.fields import MultiStringField @@ -48,7 +47,7 @@ class CheckinList(LoggedModel): 'any of the selected sales channels. This option can be useful when tickets sold at the box office ' 'are not checked again before entry and should be considered validated directly upon purchase.') ) - rules = FallbackJSONField(default=dict, blank=True) + rules = JSONField(default=dict, blank=True) objects = ScopedManager(organizer='event__organizer') diff --git a/src/pretix/base/models/orders.py b/src/pretix/base/models/orders.py index 509d4fce3..5de1fdc53 100644 --- a/src/pretix/base/models/orders.py +++ b/src/pretix/base/models/orders.py @@ -14,7 +14,7 @@ from django.conf import settings from django.db import models, transaction from django.db.models import ( - Case, Exists, F, Max, OuterRef, Q, Subquery, Sum, Value, When, + Case, Exists, F, Max, OuterRef, Q, Subquery, Sum, Value, When, JSONField, ) from django.db.models.functions import Coalesce, Greatest from django.db.models.signals import post_delete @@ -29,7 +29,6 @@ from django_countries.fields import Country from django_scopes import ScopedManager, scopes_disabled from i18nfield.strings import LazyI18nString -from jsonfallback.fields import FallbackJSONField from phonenumber_field.modelfields import PhoneNumberField from phonenumber_field.phonenumber import PhoneNumber from phonenumbers import NumberParseException @@ -333,12 +332,12 @@ def annotate_overpayments(cls, qs, results=True, refunds=True, sums=False): refund_sum=refund_sum_sq, ) qs = qs.annotate( - computed_payment_refund_sum=Coalesce(payment_sum_sq, 0) - Coalesce(refund_sum_sq, 0), + computed_payment_refund_sum=Coalesce(payment_sum_sq, Decimal('0.00')) - Coalesce(refund_sum_sq, Decimal('0.00')), ) qs = qs.annotate( - pending_sum_t=F('total') - Coalesce(payment_sum_sq, 0) + Coalesce(refund_sum_sq, 0), - pending_sum_rc=-1 * Coalesce(payment_sum_sq, 0) + Coalesce(refund_sum_sq, 0), + pending_sum_t=F('total') - Coalesce(payment_sum_sq, Decimal('0.00')) + Coalesce(refund_sum_sq, Decimal('0.00')), + pending_sum_rc=-1 * Coalesce(payment_sum_sq, Decimal('0.00')) + Coalesce(refund_sum_sq, Decimal('0.00')), ) if refunds: qs = qs.annotate( @@ -349,23 +348,23 @@ def annotate_overpayments(cls, qs, results=True, refunds=True, sums=False): qs = qs.annotate( is_overpaid=Case( When(~Q(status=Order.STATUS_CANCELED) & Q(pending_sum_t__lt=-1e-8), - then=Value('1')), + then=Value(1)), When(Q(status=Order.STATUS_CANCELED) & Q(pending_sum_rc__lt=-1e-8), - then=Value('1')), - default=Value('0'), + then=Value(1)), + default=Value(0), output_field=models.IntegerField() ), is_pending_with_full_payment=Case( When(Q(status__in=(Order.STATUS_EXPIRED, Order.STATUS_PENDING)) & Q(pending_sum_t__lte=1e-8) & Q(require_approval=False), - then=Value('1')), - default=Value('0'), + then=Value(1)), + default=Value(0), output_field=models.IntegerField() ), is_underpaid=Case( When(Q(status=Order.STATUS_PAID) & Q(pending_sum_t__gt=1e-8), - then=Value('1')), - default=Value('0'), + then=Value(1)), + default=Value(0), output_field=models.IntegerField() ) ) @@ -1135,7 +1134,7 @@ class AbstractPosition(models.Model): blank=True, null=True, help_text=_("Empty, if this product is not an admission ticket") ) - attendee_name_parts = FallbackJSONField( + attendee_name_parts = JSONField( blank=True, default=dict ) attendee_email = models.EmailField( @@ -2255,7 +2254,7 @@ class InvoiceAddress(models.Model): is_business = models.BooleanField(default=False, verbose_name=_('Business customer')) company = models.CharField(max_length=255, blank=True, verbose_name=_('Company name')) name_cached = models.CharField(max_length=255, verbose_name=_('Full name'), blank=True) - name_parts = FallbackJSONField(default=dict) + name_parts = JSONField(default=dict) street = models.TextField(verbose_name=_('Address'), blank=False) zipcode = models.CharField(max_length=30, verbose_name=_('ZIP code'), blank=False) city = models.CharField(max_length=255, verbose_name=_('City'), blank=False) diff --git a/src/pretix/base/models/waitinglist.py b/src/pretix/base/models/waitinglist.py index 2dd5bcc0f..d0bc6861e 100644 --- a/src/pretix/base/models/waitinglist.py +++ b/src/pretix/base/models/waitinglist.py @@ -2,10 +2,10 @@ from django.core.exceptions import ValidationError from django.db import models, transaction +from django.db.models import JSONField from django.utils.timezone import now from django.utils.translation import gettext_lazy as _, pgettext_lazy from django_scopes import ScopedManager -from jsonfallback.fields import FallbackJSONField from phonenumber_field.modelfields import PhoneNumberField from pretix.base.email import get_email_context @@ -45,7 +45,7 @@ class WaitingListEntry(LoggedModel): verbose_name=_("Name"), blank=True, null=True, ) - name_parts = FallbackJSONField( + name_parts = JSONField( blank=True, default=dict ) email = models.EmailField( diff --git a/src/pretix/helpers/models.py b/src/pretix/helpers/models.py index 2451a71d0..a0b0b2b68 100644 --- a/src/pretix/helpers/models.py +++ b/src/pretix/helpers/models.py @@ -1,5 +1,6 @@ import copy +from django.core.files import File from django.db import models @@ -16,7 +17,7 @@ def modelcopy(obj: models.Model, **kwargs): n = obj.__class__(**kwargs) for f in obj._meta.fields: val = getattr(obj, f.name) - if isinstance(val, models.Model): + if isinstance(val, (models.Model, File)): setattr(n, f.name, copy.copy(val)) else: setattr(n, f.name, copy.deepcopy(val)) diff --git a/src/pretix/helpers/templatetags/jsonfield.py b/src/pretix/helpers/templatetags/jsonfield.py new file mode 100644 index 000000000..bb04757ab --- /dev/null +++ b/src/pretix/helpers/templatetags/jsonfield.py @@ -0,0 +1,61 @@ +# replacement for jsonfallback functions copied from +# https://github.com/raphaelm/django-jsonfallback + +import copy +from django.db import NotSupportedError +from django.db.models import Expression, JSONField + +def mysql_compile_json_path(key_transforms): + path = ['$'] + for key_transform in key_transforms: + try: + num = int(key_transform) + path.append('[{}]'.format(num)) + except ValueError: # non-integer + path.append('.') + path.append(key_transform) + return ''.join(path) + +def postgres_compile_json_path(key_transforms): + return "{" + ','.join(key_transforms) + "}" + +class JSONExtract(Expression): + def __init__(self, expression, *path, output_field=JSONField(), **extra): + super().__init__(output_field=output_field) + self.path = path + self.source_expression = self._parse_expressions(expression)[0] + self.extra = extra + + def resolve_expression(self, query=None, allow_joins=True, reuse=None, summarize=False, for_save=False): + c = self.copy() + c.is_summary = summarize + c.source_expression = c.source_expression.resolve_expression(query, allow_joins, reuse, summarize, for_save) + return c + + def as_sql(self, compiler, connection, function=None, template=None, arg_joiner=None, **extra_context): + if '.postgresql' in connection.settings_dict['ENGINE']: + params = [] + arg_sql, arg_params = compiler.compile(self.source_expression) + params.extend(arg_params) + json_path = postgres_compile_json_path(self.path) + params.append(json_path) + template = '{} #> %s'.format(arg_sql) + return template, params + elif '.mysql' in connection.settings_dict['ENGINE']: + params = [] + arg_sql, arg_params = compiler.compile(self.source_expression) + params.extend(arg_params) + json_path = mysql_compile_json_path(self.path) + params.append(json_path) + template = 'JSON_EXTRACT({}, %s)'.format(arg_sql) + return template, params + else: + raise NotSupportedError( + 'Functions on JSONFields are only supported on PostgreSQL and MySQL at the moment.' + ) + + def copy(self): + c = super().copy() + c.source_expression = copy.copy(self.source_expression) + c.extra = self.extra.copy() + return c diff --git a/src/pretix/plugins/badges/exporters.py b/src/pretix/plugins/badges/exporters.py index be3042cbc..407b85bb0 100644 --- a/src/pretix/plugins/badges/exporters.py +++ b/src/pretix/plugins/badges/exporters.py @@ -15,7 +15,6 @@ from django.db.models.functions import Coalesce from django.utils.timezone import make_aware from django.utils.translation import gettext as _, gettext_lazy -from jsonfallback.functions import JSONExtract from reportlab.lib import pagesizes from reportlab.lib.units import mm from reportlab.pdfgen import canvas @@ -28,6 +27,7 @@ from pretix.base.settings import PERSON_NAME_SCHEMES from pretix.plugins.badges.models import BadgeItem, BadgeLayout +from ...helpers.templatetags.jsonfield import JSONExtract def _renderer(event, layout): if layout is None: diff --git a/src/pretix/plugins/checkinlists/exporters.py b/src/pretix/plugins/checkinlists/exporters.py index 197e2dcff..b05522087 100644 --- a/src/pretix/plugins/checkinlists/exporters.py +++ b/src/pretix/plugins/checkinlists/exporters.py @@ -12,7 +12,6 @@ from django.utils.formats import date_format from django.utils.timezone import is_aware, make_aware from django.utils.translation import gettext as _, gettext_lazy, pgettext -from jsonfallback.functions import JSONExtract from pytz import UTC from reportlab.lib.units import mm from reportlab.platypus import Flowable, Paragraph, Spacer, Table, TableStyle @@ -26,6 +25,8 @@ from pretix.control.forms.widgets import Select2 from pretix.plugins.reports.exporters import ReportlabExportMixin +from ...helpers.templatetags.jsonfield import JSONExtract + class CheckInListMixin(BaseExporter): @property diff --git a/src/pretix/plugins/ticketoutputpdf/exporters.py b/src/pretix/plugins/ticketoutputpdf/exporters.py index 6f70de65c..31ac21923 100644 --- a/src/pretix/plugins/ticketoutputpdf/exporters.py +++ b/src/pretix/plugins/ticketoutputpdf/exporters.py @@ -10,7 +10,6 @@ from django.db.models.functions import Coalesce from django.utils.timezone import make_aware from django.utils.translation import gettext as _, gettext_lazy -from jsonfallback.functions import JSONExtract from PyPDF2.merger import PdfFileMerger from pretix.base.exporter import BaseExporter @@ -18,6 +17,8 @@ from pretix.base.models import Event, Order, OrderPosition from pretix.base.settings import PERSON_NAME_SCHEMES +from ...helpers.templatetags.jsonfield import JSONExtract + from .ticketoutput import PdfTicketOutput diff --git a/src/requirements/dev.txt b/src/requirements/dev.txt index 11bb51df2..8d5474468 100644 --- a/src/requirements/dev.txt +++ b/src/requirements/dev.txt @@ -1,4 +1,4 @@ -django-debug-toolbar==2.1 +django-debug-toolbar==3.2 # Testing requirements pycodestyle==2.5.* pyflakes==2.1.* @@ -12,7 +12,7 @@ pytest-django==4.* isort pytest-rerunfailures==9.* pytest-mock==2.0.* -responses +responses==0.23.0 potypo freezegun diff --git a/src/requirements/production.txt b/src/requirements/production.txt index e5664b371..f31b4bc4c 100644 --- a/src/requirements/production.txt +++ b/src/requirements/production.txt @@ -1,25 +1,25 @@ # Functional requirements -Django==3.0.*,>=3.0.14 -djangorestframework==3.11.* +Django==3.2.* +djangorestframework==3.12.* python-dateutil==2.8.* isoweek -requests==2.24.0 +requests==2.25.0 pytz -django-bootstrap3==12.0.* +django-bootstrap3==15.0.* django-formset-js-improved==0.5.0.2 django-compressor==2.4.* django-hierarkey==1.0.*,>=1.0.4 -django-filter==2.2.* +django-filter==2.4.* django-scopes==1.2.* -reportlab>=3.5.18 +reportlab>=3.5.65 PyPDF2==1.26.* -Pillow>=8.*,<9.0 +Pillow==8.* django-libsass==0.8 libsass==0.20.* django-otp==0.7.*,>=0.7.5 python-u2flib-server==4.* webauthn==0.4.* -django-formtools==2.2 +django-formtools==2.3 celery==4.4.* kombu==4.6.* django-statici18n==1.9.* @@ -41,8 +41,8 @@ jsonschema openpyxl==3.0.* django-oauth-toolkit==1.2.* oauthlib==3.1.* -django-jsonfallback>=2.1.2 psycopg2-binary +django-mysql==4.5.0 tqdm==4.* # Stripe stripe==2.42.* @@ -58,7 +58,7 @@ django-countries>=6.0 pyuca # for better sorting of country names in django-countries defusedcsv>=1.1.0 vat_moss_forked==2020.3.20.0.11.0 -django-localflavor>=2.2 +django-localflavor==3.0.* django-redis==4.11.* redis==3.4.* django-phonenumber-field==4.0.* @@ -68,6 +68,6 @@ arabic-reshaper==2.0.15 # Support for Aabic in reportlab packaging tlds>=2020041600 text-unidecode==1.* -protobuf==3.13.* +protobuf==3.15.* cryptography>=3.4.2 sepaxml==2.4.*,>=2.4.1 diff --git a/src/setup.py b/src/setup.py index 6908b6222..074102ed2 100644 --- a/src/setup.py +++ b/src/setup.py @@ -113,27 +113,27 @@ def run(self): keywords='tickets web shop ecommerce', install_requires=[ - 'Django==3.0.*,>=3.0.14', - 'djangorestframework==3.11.*', + 'Django==3.2.*', + 'djangorestframework==3.12.*', 'python-dateutil==2.8.*', 'isoweek', - 'requests==2.24.*', + 'requests==2.25.0', 'pytz', - 'django-bootstrap3==12.0.*', + 'django-bootstrap3==15.0.*', 'django-formset-js-improved==0.5.0.2', 'django-compressor==2.4.*', 'django-hierarkey==1.0.*,>=1.0.4', - 'django-filter==2.2.*', + 'django-filter==2.4.*', 'django-scopes==1.2.*', - 'reportlab>=3.5.18', - 'Pillow>=8.*,<9.0', + 'reportlab>=3.5.65', + 'Pillow=8.*', 'PyPDF2==1.26.*', 'django-libsass==0.8', 'libsass==0.20.*', 'django-otp==0.7.*,>=0.7.5', 'webauthn==0.4.*', 'python-u2flib-server==4.*', - 'django-formtools==2.2', + 'django-formtools==2.3', 'celery==4.4.*', 'kombu==4.6.*', 'django-statici18n==1.9.*', @@ -157,8 +157,8 @@ def run(self): 'chardet<3.1.0,>=3.0.2', 'mt-940==3.2', 'django-i18nfield==1.9.*,>=1.9.1', - 'django-jsonfallback>=2.1.2', 'psycopg2-binary', + 'django-mysql', 'tqdm==4.*', 'vobject==0.9.*', 'pycountry', @@ -166,7 +166,7 @@ def run(self): 'pyuca', 'defusedcsv>=1.1.0', 'vat_moss_forked==2020.3.20.0.11.0', - 'django-localflavor>=2.2', + 'django-localflavor==3.0', 'jsonschema', 'django-hijack>=2.1.10,<2.2.0', 'openpyxl==3.0.*', @@ -179,13 +179,13 @@ def run(self): 'packaging', 'tlds>=2020041600', 'text-unidecode==1.*', - 'protobuf==3.13.*', + 'protobuf==3.15.*', 'cryptography>=3.4.2', 'sepaxml==2.4.*,>=2.4.1', ], extras_require={ 'dev': [ - 'django-debug-toolbar==2.1', + 'django-debug-toolbar==3.2', 'pycodestyle==2.5.*', 'pyflakes==2.1.*', 'flake8==3.7.*', @@ -198,7 +198,7 @@ def run(self): 'isort', 'pytest-mock==2.0.*', 'pytest-rerunfailures==9.*', - 'responses', + 'responses==0.23.0', 'potypo', 'freezegun', ], diff --git a/src/tests/api/test_idempotency.py b/src/tests/api/test_idempotency.py index c92545d5d..950040d5b 100644 --- a/src/tests/api/test_idempotency.py +++ b/src/tests/api/test_idempotency.py @@ -46,7 +46,7 @@ def test_scoped_by_key(token_client, organizer): PAYLOAD, format='json', HTTP_X_IDEMPOTENCY_KEY='foo') assert resp.status_code == 201 assert d1.data == json.loads(resp.content.decode()) - assert d1._headers == resp._headers + assert d1.headers._store == resp.headers._store resp = token_client.post('/api/v1/organizers/{}/events/'.format(organizer.slug), PAYLOAD, format='json', HTTP_X_IDEMPOTENCY_KEY='bar') assert resp.status_code == 400 diff --git a/src/tests/control/test_auth.py b/src/tests/control/test_auth.py index 70462ff77..34d38cee2 100644 --- a/src/tests/control/test_auth.py +++ b/src/tests/control/test_auth.py @@ -1,5 +1,5 @@ import time -from datetime import date, timedelta +from datetime import datetime, timedelta import pytest from django.conf import settings @@ -492,8 +492,8 @@ def test_recovery_invalid_token(self): def test_recovery_expired_token(self): class Mocked(PasswordResetTokenGenerator): - def _today(self): - return date.today() - timedelta(settings.PASSWORD_RESET_TIMEOUT_DAYS + 1) + def _now(self): + return datetime.now() - timedelta(seconds=settings.PASSWORD_RESET_TIMEOUT + 3600) generator = Mocked() token = generator.make_token(self.user) From 616b6903b4782ea9dcbe63d0aafb3378d0d329ec Mon Sep 17 00:00:00 2001 From: Shivangi-ch <57783826+Shivangi-ch@users.noreply.github.com> Date: Mon, 18 Mar 2024 22:49:59 +0530 Subject: [PATCH 06/10] update color theme to blue (#41) --- .../templates/pretixcontrol/auth/base.html | 6 +++--- .../control/templates/pretixcontrol/base.html | 6 +++--- .../pretixcontrol/checkin/list_delete.html | 2 +- .../templates/pretixcontrol/checkin/lists.html | 2 +- .../pretixcontrol/event/dangerzone.html | 6 +++--- .../templates/pretixcontrol/event/delete.html | 6 +++--- .../templates/pretixcontrol/event/live.html | 4 ++-- .../pretixcontrol/event/quick_setup.html | 2 +- .../templates/pretixcontrol/event/settings.html | 8 ++++---- .../pretixcontrol/event/tax_delete.html | 2 +- .../templates/pretixcontrol/event/tax_edit.html | 4 ++-- .../templates/pretixcontrol/event/tax_index.html | 2 +- .../templates/pretixcontrol/item/delete.html | 2 +- .../pretixcontrol/item/include_addons.html | 4 ++-- .../pretixcontrol/item/include_bundles.html | 4 ++-- .../pretixcontrol/item/include_variations.html | 4 ++-- .../pretixcontrol/items/categories.html | 2 +- .../pretixcontrol/items/category_delete.html | 2 +- .../templates/pretixcontrol/items/index.html | 2 +- .../pretixcontrol/items/question_delete.html | 2 +- .../pretixcontrol/items/question_edit.html | 4 ++-- .../templates/pretixcontrol/items/questions.html | 2 +- .../pretixcontrol/items/quota_delete.html | 2 +- .../templates/pretixcontrol/items/quotas.html | 2 +- .../pretixcontrol/oauth/app_delete.html | 2 +- .../templates/pretixcontrol/oauth/app_list.html | 2 +- .../pretixcontrol/oauth/app_rollkeys.html | 2 +- .../templates/pretixcontrol/order/cancel.html | 2 +- .../order/cancellation_request_delete.html | 2 +- .../templates/pretixcontrol/order/change.html | 4 ++-- .../templates/pretixcontrol/order/delete.html | 2 +- .../templates/pretixcontrol/order/index.html | 6 +++--- .../pretixcontrol/order/pay_cancel.html | 2 +- .../pretixcontrol/order/reactivate.html | 2 +- .../pretixcontrol/order/refund_cancel.html | 2 +- .../pretixcontrol/order/refund_choose.html | 2 +- .../templates/pretixcontrol/orders/cancel.html | 2 +- .../templates/pretixcontrol/orders/refunds.html | 2 +- .../pretixcontrol/organizers/delete.html | 2 +- .../templates/pretixcontrol/organizers/edit.html | 2 +- .../pretixcontrol/organizers/gate_delete.html | 2 +- .../pretixcontrol/organizers/gates.html | 2 +- .../pretixcontrol/organizers/giftcards.html | 2 +- .../pretixcontrol/organizers/properties.html | 2 +- .../organizers/property_delete.html | 2 +- .../pretixcontrol/organizers/team_delete.html | 2 +- .../pretixcontrol/organizers/team_members.html | 6 +++--- .../pretixcontrol/organizers/teams.html | 2 +- .../templates/pretixcontrol/pdf/index.html | 2 +- .../templates/pretixcontrol/subevents/bulk.html | 16 ++++++++-------- .../pretixcontrol/subevents/bulk_edit.html | 8 ++++---- .../pretixcontrol/subevents/delete.html | 2 +- .../pretixcontrol/subevents/delete_bulk.html | 2 +- .../pretixcontrol/subevents/detail.html | 8 ++++---- .../templates/pretixcontrol/subevents/index.html | 4 ++-- .../templates/pretixcontrol/user/2fa_delete.html | 2 +- .../pretixcontrol/user/2fa_disable.html | 2 +- .../templates/pretixcontrol/user/2fa_main.html | 2 +- .../templates/pretixcontrol/users/anonymize.html | 2 +- .../templates/pretixcontrol/vouchers/delete.html | 2 +- .../pretixcontrol/vouchers/delete_bulk.html | 2 +- .../templates/pretixcontrol/vouchers/index.html | 2 +- .../pretixcontrol/waitinglist/delete.html | 2 +- .../pretixcontrol/waitinglist/index.html | 4 ++-- src/pretix/control/views/__init__.py | 2 +- .../templates/pretixplugins/badges/delete.html | 2 +- .../templates/pretixplugins/badges/index.html | 2 +- .../pretixplugins/banktransfer/import_form.html | 2 +- .../pretixplugins/statistics/statistics.js | 6 +++--- .../pretixplugins/ticketoutputpdf/delete.html | 2 +- .../pretixplugins/ticketoutputpdf/index.html | 2 +- .../presale/templates/pretixpresale/base.html | 6 +++--- .../templates/pretixpresale/event/order.html | 4 ++-- .../pretixpresale/event/order_cancel.html | 2 +- src/pretix/presale/views/theme.py | 6 +++--- .../pretixbase/img/pretix-icon-colored.svg | 2 +- src/pretix/static/pretixbase/img/pretix-logo.svg | 2 +- src/pretix/static/pretixbase/img/pretixscan.svg | 2 +- src/pretix/static/pretixbase/scss/_theme.scss | 6 ++++++ .../static/pretixbase/scss/_variables.scss | 6 +++--- src/pretix/static/pretixcontrol/scss/_forms.scss | 4 ++++ .../pretixpresale/pdf/powered_by_pretix_dark.svg | 4 ++-- src/tests/presale/test_widget.py | 6 +++--- 83 files changed, 140 insertions(+), 130 deletions(-) diff --git a/src/pretix/control/templates/pretixcontrol/auth/base.html b/src/pretix/control/templates/pretixcontrol/auth/base.html index b91ace844..21b492013 100644 --- a/src/pretix/control/templates/pretixcontrol/auth/base.html +++ b/src/pretix/control/templates/pretixcontrol/auth/base.html @@ -22,10 +22,10 @@ - - + + - +
diff --git a/src/pretix/control/templates/pretixcontrol/base.html b/src/pretix/control/templates/pretixcontrol/base.html index dc6c2d81a..f2ead9098 100644 --- a/src/pretix/control/templates/pretixcontrol/base.html +++ b/src/pretix/control/templates/pretixcontrol/base.html @@ -75,10 +75,10 @@ - - + + - + {% block custom_header %}{% endblock %} diff --git a/src/pretix/control/templates/pretixcontrol/checkin/list_delete.html b/src/pretix/control/templates/pretixcontrol/checkin/list_delete.html index 99a023cbe..cd2a06429 100644 --- a/src/pretix/control/templates/pretixcontrol/checkin/list_delete.html +++ b/src/pretix/control/templates/pretixcontrol/checkin/list_delete.html @@ -17,7 +17,7 @@

{% trans "Delete check-in list" %}

class="btn btn-default btn-cancel"> {% trans "Cancel" %} -
diff --git a/src/pretix/control/templates/pretixcontrol/checkin/lists.html b/src/pretix/control/templates/pretixcontrol/checkin/lists.html index 23e967e17..645209f24 100644 --- a/src/pretix/control/templates/pretixcontrol/checkin/lists.html +++ b/src/pretix/control/templates/pretixcontrol/checkin/lists.html @@ -134,7 +134,7 @@

{% trans "Check-in lists" %}

- + {% endif %} diff --git a/src/pretix/control/templates/pretixcontrol/event/dangerzone.html b/src/pretix/control/templates/pretixcontrol/event/dangerzone.html index 24d7a3259..98fc84cae 100644 --- a/src/pretix/control/templates/pretixcontrol/event/dangerzone.html +++ b/src/pretix/control/templates/pretixcontrol/event/dangerzone.html @@ -42,7 +42,7 @@

{% trans "Cancel event" %}

+ class="btn btn-delete btn-danger btn-block btn-lg {% if not request.event.allow_delete %}disabled{% endif %}"> {% trans "Delete event" %} diff --git a/src/pretix/control/templates/pretixcontrol/event/delete.html b/src/pretix/control/templates/pretixcontrol/event/delete.html index 6cbb4c709..14b481b52 100644 --- a/src/pretix/control/templates/pretixcontrol/event/delete.html +++ b/src/pretix/control/templates/pretixcontrol/event/delete.html @@ -26,7 +26,7 @@

{% trans "Delete event" %}

{% bootstrap_field form.slug layout="inline" %}
-
@@ -51,7 +51,7 @@

{% trans "Delete event" %}

- + {% trans "Delete personal data" %} @@ -65,7 +65,7 @@

{% trans "Delete event" %}

{% trans "However, since your shop is offline, it is only visible to the organizing team according to the permissions you configured." %}

- + {% trans "Delete personal data" %} diff --git a/src/pretix/control/templates/pretixcontrol/event/live.html b/src/pretix/control/templates/pretixcontrol/event/live.html index 79dcad7fb..0a27563f0 100644 --- a/src/pretix/control/templates/pretixcontrol/event/live.html +++ b/src/pretix/control/templates/pretixcontrol/event/live.html @@ -115,7 +115,7 @@

{% trans "Shop status" %}

{% csrf_token %} -
@@ -126,7 +126,7 @@

{% trans "Shop status" %}

+ class="btn btn-delete btn-danger btn-default btn-lg"> {% trans "Cancel or delete event" %} diff --git a/src/pretix/control/templates/pretixcontrol/event/quick_setup.html b/src/pretix/control/templates/pretixcontrol/event/quick_setup.html index 571c1c5e3..efccded16 100644 --- a/src/pretix/control/templates/pretixcontrol/event/quick_setup.html +++ b/src/pretix/control/templates/pretixcontrol/event/quick_setup.html @@ -66,7 +66,7 @@

{% trans "Congratulations!" %}

{% bootstrap_field iform.quota layout='inline' form_group_class="" %}
-
diff --git a/src/pretix/control/templates/pretixcontrol/event/settings.html b/src/pretix/control/templates/pretixcontrol/event/settings.html index 6e55f7801..ded070e6a 100644 --- a/src/pretix/control/templates/pretixcontrol/event/settings.html +++ b/src/pretix/control/templates/pretixcontrol/event/settings.html @@ -152,7 +152,7 @@

{% trans "Other settings" %}

-
@@ -175,7 +175,7 @@

{% trans "Other settings" %}

- @@ -284,7 +284,7 @@

{% trans "Other settings" %}

{% bootstrap_field form.default layout='inline' form_group_class="" %}
-
@@ -304,7 +304,7 @@

{% trans "Other settings" %}

{% bootstrap_field item_meta_property_formset.empty_form.default layout='inline' form_group_class="" %}
-
diff --git a/src/pretix/control/templates/pretixcontrol/event/tax_delete.html b/src/pretix/control/templates/pretixcontrol/event/tax_delete.html index 2f4cd0a5a..862438695 100644 --- a/src/pretix/control/templates/pretixcontrol/event/tax_delete.html +++ b/src/pretix/control/templates/pretixcontrol/event/tax_delete.html @@ -17,7 +17,7 @@

{% trans "Delete tax rule" %}

{% trans "Cancel" %} {% if possible %} - {% endif %} diff --git a/src/pretix/control/templates/pretixcontrol/event/tax_edit.html b/src/pretix/control/templates/pretixcontrol/event/tax_edit.html index 3864ce4d8..d3ecb19fd 100644 --- a/src/pretix/control/templates/pretixcontrol/event/tax_edit.html +++ b/src/pretix/control/templates/pretixcontrol/event/tax_edit.html @@ -75,7 +75,7 @@

{% trans "Custom taxation rules" %}

-
@@ -110,7 +110,7 @@

{% trans "Custom taxation rules" %}

-
diff --git a/src/pretix/control/templates/pretixcontrol/event/tax_index.html b/src/pretix/control/templates/pretixcontrol/event/tax_index.html index 466bc93a1..02b20c77e 100644 --- a/src/pretix/control/templates/pretixcontrol/event/tax_index.html +++ b/src/pretix/control/templates/pretixcontrol/event/tax_index.html @@ -39,7 +39,7 @@

{% trans "Tax rules" %}

{{ tr.rate }} % - + {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/item/delete.html b/src/pretix/control/templates/pretixcontrol/item/delete.html index d8f368901..85f701128 100644 --- a/src/pretix/control/templates/pretixcontrol/item/delete.html +++ b/src/pretix/control/templates/pretixcontrol/item/delete.html @@ -37,7 +37,7 @@

{% trans "Delete product" %}

{% trans "Cancel" %} -
diff --git a/src/pretix/control/templates/pretixcontrol/item/include_addons.html b/src/pretix/control/templates/pretixcontrol/item/include_addons.html index c60264cbe..9a76a4f7a 100644 --- a/src/pretix/control/templates/pretixcontrol/item/include_addons.html +++ b/src/pretix/control/templates/pretixcontrol/item/include_addons.html @@ -32,7 +32,7 @@

{% trans "Add-On" %}

- @@ -66,7 +66,7 @@

{% trans "Add-On" %}

- diff --git a/src/pretix/control/templates/pretixcontrol/item/include_bundles.html b/src/pretix/control/templates/pretixcontrol/item/include_bundles.html index cfa489dc1..13f38734b 100644 --- a/src/pretix/control/templates/pretixcontrol/item/include_bundles.html +++ b/src/pretix/control/templates/pretixcontrol/item/include_bundles.html @@ -23,7 +23,7 @@

{% trans "Bundled product" %}

-
@@ -50,7 +50,7 @@

{% trans "Bundled product" %}

{% trans "Bundled product" %}

-
diff --git a/src/pretix/control/templates/pretixcontrol/item/include_variations.html b/src/pretix/control/templates/pretixcontrol/item/include_variations.html index 584afd90c..b5c9bf836 100644 --- a/src/pretix/control/templates/pretixcontrol/item/include_variations.html +++ b/src/pretix/control/templates/pretixcontrol/item/include_variations.html @@ -23,7 +23,7 @@

- {% if form.instance.id %}
#{{ form.instance.id }} @@ -69,7 +69,7 @@

- diff --git a/src/pretix/control/templates/pretixcontrol/items/categories.html b/src/pretix/control/templates/pretixcontrol/items/categories.html index 237062ccf..9156b3728 100644 --- a/src/pretix/control/templates/pretixcontrol/items/categories.html +++ b/src/pretix/control/templates/pretixcontrol/items/categories.html @@ -49,7 +49,7 @@

{% trans "Product categories" %}

class="btn btn-sm btn-default" title="{% trans "Clone" %}" data-toggle="tooltip"> - + {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/items/category_delete.html b/src/pretix/control/templates/pretixcontrol/items/category_delete.html index eed8e3b7e..17149ef26 100644 --- a/src/pretix/control/templates/pretixcontrol/items/category_delete.html +++ b/src/pretix/control/templates/pretixcontrol/items/category_delete.html @@ -13,7 +13,7 @@

{% trans "Delete product category" %}

{% trans "Cancel" %} - diff --git a/src/pretix/control/templates/pretixcontrol/items/index.html b/src/pretix/control/templates/pretixcontrol/items/index.html index ec00e86d6..39a7cb432 100644 --- a/src/pretix/control/templates/pretixcontrol/items/index.html +++ b/src/pretix/control/templates/pretixcontrol/items/index.html @@ -112,7 +112,7 @@

{% trans "Products" %}

- + {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/items/question_delete.html b/src/pretix/control/templates/pretixcontrol/items/question_delete.html index 36aaf3e88..ad8f15fe5 100644 --- a/src/pretix/control/templates/pretixcontrol/items/question_delete.html +++ b/src/pretix/control/templates/pretixcontrol/items/question_delete.html @@ -17,7 +17,7 @@

{% trans "Delete question" %}

{% trans "Cancel" %} - diff --git a/src/pretix/control/templates/pretixcontrol/items/question_edit.html b/src/pretix/control/templates/pretixcontrol/items/question_edit.html index 827d42075..650fb88af 100644 --- a/src/pretix/control/templates/pretixcontrol/items/question_edit.html +++ b/src/pretix/control/templates/pretixcontrol/items/question_edit.html @@ -76,7 +76,7 @@

{% trans "Answer options" %}

- @@ -104,7 +104,7 @@

{% trans "Answer options" %}

- diff --git a/src/pretix/control/templates/pretixcontrol/items/questions.html b/src/pretix/control/templates/pretixcontrol/items/questions.html index 60a4c8715..410719d70 100644 --- a/src/pretix/control/templates/pretixcontrol/items/questions.html +++ b/src/pretix/control/templates/pretixcontrol/items/questions.html @@ -85,7 +85,7 @@

{% trans "Questions" %}

{% if q.pk %} - + {% else %} diff --git a/src/pretix/control/templates/pretixcontrol/items/quota_delete.html b/src/pretix/control/templates/pretixcontrol/items/quota_delete.html index c6999d4d8..1f14b78f1 100644 --- a/src/pretix/control/templates/pretixcontrol/items/quota_delete.html +++ b/src/pretix/control/templates/pretixcontrol/items/quota_delete.html @@ -36,7 +36,7 @@

{% trans "Delete quota" %}

{% trans "Cancel" %} - diff --git a/src/pretix/control/templates/pretixcontrol/items/quotas.html b/src/pretix/control/templates/pretixcontrol/items/quotas.html index 447658623..5e1a91cc0 100644 --- a/src/pretix/control/templates/pretixcontrol/items/quotas.html +++ b/src/pretix/control/templates/pretixcontrol/items/quotas.html @@ -93,7 +93,7 @@

{% trans "Quotas" %}

class="btn btn-sm btn-default" title="{% trans "Clone" %}" data-toggle="tooltip"> - + {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/oauth/app_delete.html b/src/pretix/control/templates/pretixcontrol/oauth/app_delete.html index efdb5f80d..505f6f79e 100644 --- a/src/pretix/control/templates/pretixcontrol/oauth/app_delete.html +++ b/src/pretix/control/templates/pretixcontrol/oauth/app_delete.html @@ -11,7 +11,7 @@

{% trans "Disable application" %}

{% trans "Cancel" %} - diff --git a/src/pretix/control/templates/pretixcontrol/oauth/app_list.html b/src/pretix/control/templates/pretixcontrol/oauth/app_list.html index 2caf4d99b..f03caacb9 100644 --- a/src/pretix/control/templates/pretixcontrol/oauth/app_list.html +++ b/src/pretix/control/templates/pretixcontrol/oauth/app_list.html @@ -20,7 +20,7 @@

{% trans "Your applications" %}

- + {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/oauth/app_rollkeys.html b/src/pretix/control/templates/pretixcontrol/oauth/app_rollkeys.html index c4385d842..09424d27c 100644 --- a/src/pretix/control/templates/pretixcontrol/oauth/app_rollkeys.html +++ b/src/pretix/control/templates/pretixcontrol/oauth/app_rollkeys.html @@ -8,7 +8,7 @@

{% trans "Generate new application secret" %}

{% csrf_token %}

{% blocktrans %}Are you sure you want to generate a new client secret for the application {{ application }}?{% endblocktrans %}

- + {% trans "Cancel" %}
-
diff --git a/src/pretix/control/templates/pretixcontrol/order/cancellation_request_delete.html b/src/pretix/control/templates/pretixcontrol/order/cancellation_request_delete.html index d2dcdbe39..793ff0890 100644 --- a/src/pretix/control/templates/pretixcontrol/order/cancellation_request_delete.html +++ b/src/pretix/control/templates/pretixcontrol/order/cancellation_request_delete.html @@ -22,7 +22,7 @@

-
diff --git a/src/pretix/control/templates/pretixcontrol/order/change.html b/src/pretix/control/templates/pretixcontrol/order/change.html index 6cb851e52..788bdcc87 100644 --- a/src/pretix/control/templates/pretixcontrol/order/change.html +++ b/src/pretix/control/templates/pretixcontrol/order/change.html @@ -205,7 +205,7 @@

- @@ -243,7 +243,7 @@

- diff --git a/src/pretix/control/templates/pretixcontrol/order/delete.html b/src/pretix/control/templates/pretixcontrol/order/delete.html index b19524113..ac94c0186 100644 --- a/src/pretix/control/templates/pretixcontrol/order/delete.html +++ b/src/pretix/control/templates/pretixcontrol/order/delete.html @@ -21,7 +21,7 @@

-
diff --git a/src/pretix/control/templates/pretixcontrol/order/index.html b/src/pretix/control/templates/pretixcontrol/order/index.html index 5aef10a8d..5d09ea9cc 100644 --- a/src/pretix/control/templates/pretixcontrol/order/index.html +++ b/src/pretix/control/templates/pretixcontrol/order/index.html @@ -32,7 +32,7 @@

{% if order.testmode %} + class="btn btn-delete btn-danger"> {% trans "Delete" %} @@ -637,7 +637,7 @@

{{ p.payment_provider.verbose_name }} {% if p.state == "pending" or p.state == "created" %} @@ -739,7 +739,7 @@

{% if r.state == "transit" or r.state == "created" %} diff --git a/src/pretix/control/templates/pretixcontrol/order/pay_cancel.html b/src/pretix/control/templates/pretixcontrol/order/pay_cancel.html index f39efc9f9..240930c35 100644 --- a/src/pretix/control/templates/pretixcontrol/order/pay_cancel.html +++ b/src/pretix/control/templates/pretixcontrol/order/pay_cancel.html @@ -21,7 +21,7 @@

-
diff --git a/src/pretix/control/templates/pretixcontrol/order/reactivate.html b/src/pretix/control/templates/pretixcontrol/order/reactivate.html index 7b07fe077..5e8c51369 100644 --- a/src/pretix/control/templates/pretixcontrol/order/reactivate.html +++ b/src/pretix/control/templates/pretixcontrol/order/reactivate.html @@ -26,7 +26,7 @@

{% csrf_token %} {% bootstrap_form form layout='horizontal' horizontal_label_class='sr-only' horizontal_field_class='col-md-12' %}
- {% trans "Cancel" %} diff --git a/src/pretix/control/templates/pretixcontrol/order/refund_cancel.html b/src/pretix/control/templates/pretixcontrol/order/refund_cancel.html index c78d01928..cf106ca78 100644 --- a/src/pretix/control/templates/pretixcontrol/order/refund_cancel.html +++ b/src/pretix/control/templates/pretixcontrol/order/refund_cancel.html @@ -28,7 +28,7 @@

-
diff --git a/src/pretix/control/templates/pretixcontrol/order/refund_choose.html b/src/pretix/control/templates/pretixcontrol/order/refund_choose.html index 1d384b740..684625dbb 100644 --- a/src/pretix/control/templates/pretixcontrol/order/refund_choose.html +++ b/src/pretix/control/templates/pretixcontrol/order/refund_choose.html @@ -197,7 +197,7 @@

{% trans "Refund to a different payment method" %}

- {% trans "Cancel" %} diff --git a/src/pretix/control/templates/pretixcontrol/orders/cancel.html b/src/pretix/control/templates/pretixcontrol/orders/cancel.html index 47c91ecb9..617216bc8 100644 --- a/src/pretix/control/templates/pretixcontrol/orders/cancel.html +++ b/src/pretix/control/templates/pretixcontrol/orders/cancel.html @@ -79,7 +79,7 @@

{% trans "Cancel event" %}

{% bootstrap_field form.send_waitinglist_message layout="horizontal" %}
-
diff --git a/src/pretix/control/templates/pretixcontrol/orders/refunds.html b/src/pretix/control/templates/pretixcontrol/orders/refunds.html index 275ef8836..a2a3abaef 100644 --- a/src/pretix/control/templates/pretixcontrol/orders/refunds.html +++ b/src/pretix/control/templates/pretixcontrol/orders/refunds.html @@ -99,7 +99,7 @@

{% trans "Refunds" %}

{% if r.state == "transit" or r.state == "created" %} + class="btn btn-delete btn-danger btn-xs" data-toggle="tooltip"> {% trans "Cancel" %} diff --git a/src/pretix/control/templates/pretixcontrol/organizers/delete.html b/src/pretix/control/templates/pretixcontrol/organizers/delete.html index cc0c5def9..9125343a4 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/delete.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/delete.html @@ -26,7 +26,7 @@

{% trans "Delete organizer" %}

{% bootstrap_field form.slug layout="inline" %}
-
diff --git a/src/pretix/control/templates/pretixcontrol/organizers/edit.html b/src/pretix/control/templates/pretixcontrol/organizers/edit.html index 1d33e9dc9..cbc09cd11 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/edit.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/edit.html @@ -12,7 +12,7 @@

{% blocktrans with name=organizer.name %}Organizer settings{% endblocktrans %} {% if request.user.is_staff and staff_session %} + class="btn btn-delete btn-danger hidden-print"> {% endif %} diff --git a/src/pretix/control/templates/pretixcontrol/organizers/gate_delete.html b/src/pretix/control/templates/pretixcontrol/organizers/gate_delete.html index fa60d5701..5cda5146a 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/gate_delete.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/gate_delete.html @@ -11,7 +11,7 @@

{% trans "Delete gate:" %} {{ gate.name }}

{% trans "Cancel" %} -
diff --git a/src/pretix/control/templates/pretixcontrol/organizers/gates.html b/src/pretix/control/templates/pretixcontrol/organizers/gates.html index 102cb612f..9849608dd 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/gates.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/gates.html @@ -29,7 +29,7 @@

{% trans "Gates" %}

+ class="btn btn-delete btn-danger btn-sm"> {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/organizers/giftcards.html b/src/pretix/control/templates/pretixcontrol/organizers/giftcards.html index f4addac57..f143dbf11 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/giftcards.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/giftcards.html @@ -110,7 +110,7 @@

{% for gca in request.organizer.gift_card_issuer_acceptance.all %}
  • {{ gca.issuer }} -
  • diff --git a/src/pretix/control/templates/pretixcontrol/organizers/properties.html b/src/pretix/control/templates/pretixcontrol/organizers/properties.html index 84a4b0da6..c4b512ebf 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/properties.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/properties.html @@ -33,7 +33,7 @@

    {% trans "Event metadata" %}

    + class="btn btn-delete btn-danger btn-sm"> {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/organizers/property_delete.html b/src/pretix/control/templates/pretixcontrol/organizers/property_delete.html index 2c6e697c5..58f7b9c9e 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/property_delete.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/property_delete.html @@ -11,7 +11,7 @@

    {% trans "Delete property:" %} {{ gate.name }}

    {% trans "Cancel" %} -
    diff --git a/src/pretix/control/templates/pretixcontrol/organizers/team_delete.html b/src/pretix/control/templates/pretixcontrol/organizers/team_delete.html index eaa6598dc..85a8b91f9 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/team_delete.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/team_delete.html @@ -20,7 +20,7 @@

    {% trans "Delete team:" %} {{ team.name }}

    {% trans "Cancel" %} -
    diff --git a/src/pretix/control/templates/pretixcontrol/organizers/team_members.html b/src/pretix/control/templates/pretixcontrol/organizers/team_members.html index 3ccdd5d35..d01f6840b 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/team_members.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/team_members.html @@ -39,7 +39,7 @@

    {% trans "Team members" %}

    @@ -59,7 +59,7 @@

    {% trans "Team members" %}

    @@ -105,7 +105,7 @@

    {% trans "API tokens" %}

    diff --git a/src/pretix/control/templates/pretixcontrol/organizers/teams.html b/src/pretix/control/templates/pretixcontrol/organizers/teams.html index faecf6bce..2a8b0a2c9 100644 --- a/src/pretix/control/templates/pretixcontrol/organizers/teams.html +++ b/src/pretix/control/templates/pretixcontrol/organizers/teams.html @@ -48,7 +48,7 @@

    {% trans "Teams" %}

    + class="btn btn-delete btn-danger btn-sm"> {% endfor %} diff --git a/src/pretix/control/templates/pretixcontrol/pdf/index.html b/src/pretix/control/templates/pretixcontrol/pdf/index.html index 95d20b6b2..cbb17580b 100644 --- a/src/pretix/control/templates/pretixcontrol/pdf/index.html +++ b/src/pretix/control/templates/pretixcontrol/pdf/index.html @@ -161,7 +161,7 @@

    {% trans "Welcome to the PDF ticket editor!" %}

    title="{% trans "Copy" %}"> - diff --git a/src/pretix/control/templates/pretixcontrol/subevents/bulk.html b/src/pretix/control/templates/pretixcontrol/subevents/bulk.html index ee43c58f6..270d80d09 100644 --- a/src/pretix/control/templates/pretixcontrol/subevents/bulk.html +++ b/src/pretix/control/templates/pretixcontrol/subevents/bulk.html @@ -35,7 +35,7 @@

    {% trans "Repetition rule" %}

    -
    @@ -146,7 +146,7 @@

    {% trans "Repetition rule" %}

    -
    @@ -298,7 +298,7 @@

    {% bootstrap_field f.time_admission layout="inline" %}
    -
    @@ -324,7 +324,7 @@

    {% bootstrap_field time_formset.empty_form.time_admission layout="inline" %}
    -
    @@ -431,7 +431,7 @@

    {% bootstrap_field form.name layout='inline' form_group_class="" %}
    -
    @@ -460,7 +460,7 @@

    {% bootstrap_field formset.empty_form.name layout='inline' form_group_class="" %}
    -
    @@ -516,7 +516,7 @@

    {% bootstrap_field form.name layout='inline' form_group_class="" %}
    -
    @@ -549,7 +549,7 @@

    {% bootstrap_field cl_formset.empty_form.name layout='inline' form_group_class="" %}
    -
    diff --git a/src/pretix/control/templates/pretixcontrol/subevents/bulk_edit.html b/src/pretix/control/templates/pretixcontrol/subevents/bulk_edit.html index b1c10d9bb..29590e24f 100644 --- a/src/pretix/control/templates/pretixcontrol/subevents/bulk_edit.html +++ b/src/pretix/control/templates/pretixcontrol/subevents/bulk_edit.html @@ -198,7 +198,7 @@

    {% bootstrap_field form.name layout='inline' form_group_class="" %}
    -
    @@ -227,7 +227,7 @@

    {% bootstrap_field formset.empty_form.name layout='inline' form_group_class="" %}
    -
    @@ -283,7 +283,7 @@

    {% bootstrap_field form.name layout='inline' form_group_class="" %}
    -
    @@ -316,7 +316,7 @@

    {% bootstrap_field cl_formset.empty_form.name layout='inline' form_group_class="" %}
    -
    diff --git a/src/pretix/control/templates/pretixcontrol/subevents/delete.html b/src/pretix/control/templates/pretixcontrol/subevents/delete.html index 9db73eb1e..2230074d5 100644 --- a/src/pretix/control/templates/pretixcontrol/subevents/delete.html +++ b/src/pretix/control/templates/pretixcontrol/subevents/delete.html @@ -11,7 +11,7 @@

    {% trans "Delete date" context "subevent" %}

    {% trans "Cancel" %} - diff --git a/src/pretix/control/templates/pretixcontrol/subevents/delete_bulk.html b/src/pretix/control/templates/pretixcontrol/subevents/delete_bulk.html index f08729e06..cfa17a408 100644 --- a/src/pretix/control/templates/pretixcontrol/subevents/delete_bulk.html +++ b/src/pretix/control/templates/pretixcontrol/subevents/delete_bulk.html @@ -33,7 +33,7 @@

    {% trans "Delete dates" context "subevent" %}

    {% trans "Cancel" %} - diff --git a/src/pretix/control/templates/pretixcontrol/subevents/detail.html b/src/pretix/control/templates/pretixcontrol/subevents/detail.html index 83fc88cb8..9ed37b0e0 100644 --- a/src/pretix/control/templates/pretixcontrol/subevents/detail.html +++ b/src/pretix/control/templates/pretixcontrol/subevents/detail.html @@ -73,7 +73,7 @@

    {% bootstrap_field form.name layout='inline' form_group_class="" %}
    -
    @@ -102,7 +102,7 @@

    {% bootstrap_field formset.empty_form.name layout='inline' form_group_class="" %}
    -
    @@ -158,7 +158,7 @@

    {% bootstrap_field form.name layout='inline' form_group_class="" %}
    -
    @@ -191,7 +191,7 @@

    {% bootstrap_field cl_formset.empty_form.name layout='inline' form_group_class="" %}
    -
    diff --git a/src/pretix/control/templates/pretixcontrol/subevents/index.html b/src/pretix/control/templates/pretixcontrol/subevents/index.html index fbd52bf0d..a051449e0 100644 --- a/src/pretix/control/templates/pretixcontrol/subevents/index.html +++ b/src/pretix/control/templates/pretixcontrol/subevents/index.html @@ -157,7 +157,7 @@

    {% trans "Dates" context "subevent" %}

    - + {% endfor %} @@ -166,7 +166,7 @@

    {% trans "Dates" context "subevent" %}

    {% if "can_change_event_settings" in request.eventpermset %}
    -
    diff --git a/src/pretix/control/templates/pretixcontrol/user/2fa_disable.html b/src/pretix/control/templates/pretixcontrol/user/2fa_disable.html index e4a5e3931..53c0489c1 100644 --- a/src/pretix/control/templates/pretixcontrol/user/2fa_disable.html +++ b/src/pretix/control/templates/pretixcontrol/user/2fa_disable.html @@ -16,7 +16,7 @@

    {% trans "Disable two-factor authentication" %}

    {% trans "Cancel" %} - diff --git a/src/pretix/control/templates/pretixcontrol/user/2fa_main.html b/src/pretix/control/templates/pretixcontrol/user/2fa_main.html index 2aa63a79c..32532f165 100644 --- a/src/pretix/control/templates/pretixcontrol/user/2fa_main.html +++ b/src/pretix/control/templates/pretixcontrol/user/2fa_main.html @@ -72,7 +72,7 @@

    {% trans "Registered devices" %}