Compare commits

...
Author SHA1 Message Date
Lukas Bockstaller e4b65ba49d drop pycrytodome as a dependency from pyproject.toml 2026-11-18 14:53:01 +01:00
Lukas Bockstaller 071b8baf61 remove temporary test & Crypto from test_oidc_op.py 2026-11-18 14:51:22 +01:00
Lukas Bockstaller ff6922e2ce remove Crypto from test_oidc_op.py::test_keys_endpoint
switch out Crypto.PublicKey.RSA with
cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicNumbers in test_keys_endopoint
2026-11-18 14:48:32 +01:00
Lukas Bockstaller 428d28e744 remove Crypto from oidc_op.py
switch out Crypto.PublicKey.RSA with
cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey and from cryptography.hazmat.primitives.serialization.load_pem_public_key which we already need
2026-11-18 14:42:35 +01:00
Lukas Bockstaller 0de0ad6cae add temporary test to show that Crypto.RSA and cryptography...RSAPublicKey produce identical output 2026-11-18 14:39:57 +01:00
Lukas Bockstaller 7f046e16a2 fix: pass request object to the request parameter of the form (#6786) 2026-11-18 12:04:34 +01:00
Phin Wolkwitz 44b0cba991 Add an item availability timeframe check (Z#23253911) 2026-11-17 12:49:57 +01:00
Raphael Michel f7bdf81f83 Merge branch 'security-export-change' into 'master'
[SECURITY] Scheduled exports: Do not allow to increase scope of export beyond own permissions (CVE-2026-127174)

See merge request pretix/pretix!61
2026-11-17 12:16:03 +01:00
Raphael Michel 61063c9b46 [SECURITY] Scheduled exports: Do not allow to increase scope of export beyond own permissions (CVE-2026-127174) 2026-11-17 12:16:02 +01:00
Lukas Bockstallerandpajowu a7248d737e Reload when csrf cookie and hidden csrfmiddlewaretoken don't match (#6749)
* Reload when csrf cookie and hidden csrfmiddlewaretoken don't match

* Don't use reload to avoid double POSTing dialog

* Don't set partitioned cookies on mobile safari

* Revert "Don't set partitioned cookies on mobile safari"

This reverts commit cb38b8cc9c.

* handle duplicate cookies and add telemetry

* check if secret is on page at all

* include csrfcookieretry.js in presale generally

* move out check

* move csrfcookieretry.js to base and include it in /control/login

* Update src/pretix/static/pretixbase/js/csrfcookieretry.js

Co-authored-by: pajowu <engelhardt@pretix.eu>

---------

Co-authored-by: pajowu <engelhardt@pretix.eu>
2026-11-17 11:38:43 +01:00
Ikuisuus 330d7ebe92 Translations: Update Finnish
Currently translated at 60.3% (3897 of 6452 strings)

Translation: pretix/pretix
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix/fi/

powered by weblate
2026-11-17 11:10:54 +01:00
Ikuisuus 45eb76f4c3 Translations: Update Finnish
Currently translated at 59.7% (3858 of 6452 strings)

Translation: pretix/pretix
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix/fi/

powered by weblate
2026-11-17 11:10:54 +01:00
Raphael Michel 11896eb032 Translations: Update German (informal) (de_Informal)
Currently translated at 100.0% (6452 of 6452 strings)

Translation: pretix/pretix
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix/de_Informal/

powered by weblate
2026-11-17 11:10:54 +01:00
Dennis Lichtenthäler 0166514fef Translations: Update German (informal) (de_Informal)
Currently translated at 100.0% (6452 of 6452 strings)

Translation: pretix/pretix
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix/de_Informal/

powered by weblate
2026-11-17 11:10:54 +01:00
Raphael Michel bfda956acc Translations: Update German
Currently translated at 100.0% (6452 of 6452 strings)

Translation: pretix/pretix
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix/de/

powered by weblate
2026-11-17 11:10:54 +01:00
Dennis Lichtenthäler 52a458aca0 Translations: Update German
Currently translated at 100.0% (6452 of 6452 strings)

Translation: pretix/pretix
Translate-URL: https://translate.pretix.eu/projects/pretix/pretix/de/

powered by weblate
2026-11-17 11:10:54 +01:00
dependabot[bot] def35f9531 Update sphinxcontrib-httpdomain requirement from ~=2.1.0 to ~=2.2.1 (#6751)
Updates the requirements on [sphinxcontrib-httpdomain](https://github.com/sphinx-contrib/httpdomain) to permit the latest version.
- [Release notes](https://github.com/sphinx-contrib/httpdomain/releases)
- [Changelog](https://github.com/sphinx-contrib/httpdomain/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/sphinx-contrib/httpdomain/compare/2.1.0...2.2.1)

---
updated-dependencies:
- dependency-name: sphinxcontrib-httpdomain
  dependency-version: 2.2.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-17 10:50:15 +01:00
dependabot[bot] a91b92aa16 Update pypdf requirement from ==6.20.* to ==6.21.* (#6750)
Updates the requirements on [pypdf](https://github.com/py-pdf/pypdf) to permit the latest version.
- [Release notes](https://github.com/py-pdf/pypdf/releases)
- [Changelog](https://github.com/py-pdf/pypdf/blob/main/CHANGELOG.md)
- [Commits](https://github.com/py-pdf/pypdf/compare/6.20.0...6.21.4)

---
updated-dependencies:
- dependency-name: pypdf
  dependency-version: 6.21.4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-17 10:49:01 +01:00
Raphael Michel f346acb0d2 API: Only require transmission fields depending on method logic (#6765)
* API: Do not mark all invoice transmission fields as required

* Fix test
2026-11-13 14:34:41 +01:00
Phin Wolkwitz 0478559fd7 Accounting report: Add annotation and full daterange… (Z#23245563) (#6742)
Add an annotation and full daterange in accounting reports if "all time" is selected
2026-11-13 12:33:22 +01:00
Raphael Michel 137059dd4e Customer account login: Add rate limit (Z#23252382) (#6760)
* Customer account login: Add rate limit

* Apply suggestion from @raphaelm
2026-11-11 10:29:51 +01:00
Raphael Michel bd0b55bdd3 Reusable media API: Limit data exposed on cross-organizer requests (Z#23253153) (#6761) 2026-11-11 10:29:02 +01:00
Raphael Michel ceff9de5ee Customer step: Fix login URL for SSO in weird domain setup (#6687)
The current code links to a 404 page if the event has a custom domain
but the organizer uses the default system domain.
2026-11-10 14:44:48 +01:00
Lukas Bockstaller 38b467cef7 Add option to auto transmit invoices after modification by the customer (Z#23251416) (#6713)
* Add option to auto transmit invoices after modification by the customer

* Add caveat for peppol etc. to setting help text

* auto retransmit invoices after change

* code style
2026-11-10 14:41:19 +01:00
Raphael Michel ae95df7ea2 Merge branch 'ticketoutputpdf-security' into 'master'
[SECURITY] Fix missing permission check for ticket layout API (CVE-2026-125744)

See merge request pretix/pretix!60
2026-11-10 13:54:25 +01:00
d362f16417 Documentation for questionnaires API changes (#6704)
* Add docs pages, deprecation notes

* Add data field docs

* Items personalized deprecation

* Move paragraph

* fix indentation

* Document questionnaires resource

* Apply batched suggestions from code review

Co-authored-by: Raphael Michel <mail@raphaelmichel.de>
Co-authored-by: luelista <mira@teamwiki.de>

* rename to order_presale / position_presale

* _presale -> _purchase

* children -> rows

* change datafields API endpoint URLs

* removal of question change api endpoints

* update answers objects

* add print_on_invoice_label

* document restrictions

* Update personalized attribute

* fix inconsistent type

* Update doc/api/resources/datafields.rst

Co-authored-by: Raphael Michel <michel@pretix.eu>

* rename dependency_question -> dependency_datafield, document label/help_text fields for static text blocks

* add print_on_invoice_label to examples

* Add markers for new features

---------

Co-authored-by: Raphael Michel <mail@raphaelmichel.de>
Co-authored-by: Raphael Michel <michel@pretix.eu>
Co-authored-by: Raphael Michel <michel@rami.io>
2026-11-10 13:21:50 +01:00
Raphael Michel 7f1a0fd58f [SECURITY] Fix missing permission check for ticket layout API (CVE-2026-125744) 2026-11-10 13:13:31 +01:00
Martin Gross 6d05cfea8b Badges: Add Herma 9010 (Z#23253294) (#6759) 2026-11-10 12:29:47 +01:00
pajowu c1b8259075 Replace deprecated chained @classmethod (#6757) 2026-11-10 12:14:28 +01:00
pajowu e394054ae3 Fix duplicate default check in TicketLayoutSerializer (#6748) 2026-11-06 12:24:33 +01:00
Raphael Michel dda2a18fdf Week calendar: Fix navigation after dateutil 4.0 upgrade (#6746) 2026-11-06 10:03:55 +01:00
49 changed files with 1921 additions and 476 deletions

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@ calculated automatically.
},
"answers": [
{
"question": 1,
"datafield": "A1B2C3D4",
"answer": "23",
"options": []
}
+18 -8
View File
@@ -3,6 +3,14 @@
Cart positions
==============
.. note::
This API is affected by an upcoming larger change to our API. The API documentation already reflects the future
version. Features or fields not yet available are marked with **NEW**.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
The API provides limited access to the cart position data model. This API currently only allows creating and deleting
cart positions to reserve quota.
@@ -31,12 +39,13 @@ voucher integer Internal ID of
addon_to integer Internal ID of the position this position is an add-on for (or ``null``)
is_bundled boolean If ``addon_to`` is set, this shows whether this is a bundled product or an addon product
subevent integer ID of the date inside an event series this position belongs to (or ``null``)
answers list of objects Answers to user-defined questions
├ question integer Internal ID of the answered question
answers list of objects Values of data fields (answers to user-defined questions)
├ datafield string **NEW** The data field's ``identifier`` (internal reference)
├ answer string Text representation of the answer
├ question_identifier string The question's ``identifier`` field
├ options list of integers Internal IDs of selected option(s)s (only for choice types)
└ option_identifiers list of strings The ``identifier`` fields of the selected option(s)s
├ option_identifiers list of strings The ``identifier`` fields of the selected option(s)s
├ question integer **Deprecated.** Internal ID of the data field
└ question_identifier string **Read-only, deprecated.** The data field's ``identifier`` (internal reference)
seat objects The assigned seat (or ``null``)
├ id integer Internal ID of the seat instance
├ name string Human-readable seat name
@@ -199,7 +208,8 @@ Cart position endpoints
* ``bundled`` (optional, expect a list of nested objects of cart positions)
* ``answers``
* ``question``
* ``datafield`` **NEW**
* ``question`` **DEPRECATED**
* ``answer``
* ``options``
@@ -223,7 +233,7 @@ Cart position endpoints
"attendee_email": null,
"answers": [
{
"question": 1,
"datafield": "A1B2C3D4",
"answer": "23",
"options": []
}
@@ -285,7 +295,7 @@ Cart position endpoints
"attendee_email": null,
"answers": [
{
"question": 1,
"datafield": "A1B2C3D4",
"answer": "23",
"options": []
}
@@ -303,7 +313,7 @@ Cart position endpoints
"attendee_email": null,
"answers": [
{
"question": 1,
"datafield": "A1B2C3D4",
"answer": "23",
"options": []
}
+37 -26
View File
@@ -5,6 +5,14 @@
Check-in
========
.. note::
This API is affected by an upcoming larger change to our API. The API documentation already reflects the future
version. Features or fields not yet available are marked with **NEW**.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
This page describes special APIs built for ticket scanning apps. For managing check-in configuration or other operations,
please also see :ref:`rest-checkinlists`. The check-in list API also contains endpoints to obtain statistics or log
failed scans.
@@ -24,41 +32,43 @@ Checking a ticket in
passed needs to be from a distinct event.
:query string expand: Expand a field inside the ``position`` object into a full object. Currently ``subevent``, ``item``, ``variation``, and ``answers.question`` are supported. Can be passed multiple times.
:<json string secret: Scanned QR code corresponding to the ``secret`` attribute of a ticket.
:<json string source_type: Type of source the ``secret`` was obtained form. Defaults to ``"barcode"``.
:<json array lists: List of check-in list IDs to search on. No two check-in lists may be from the same event.
:<json string type: Send ``"exit"`` for an exit and ``"entry"`` (default) for an entry.
:<json datetime datetime: Specifies the datetime of the check-in. If not supplied, the current time will be used.
:<json boolean force: Specifies that the check-in should succeed regardless of revoked barcode, previous check-ins or required
:>json string secret: Scanned QR code corresponding to the ``secret`` attribute of a ticket.
:>json string source_type: Type of source the ``secret`` was obtained form. Defaults to ``"barcode"``.
:>json array lists: List of check-in list IDs to search on. No two check-in lists may be from the same event.
:>json string type: Send ``"exit"`` for an exit and ``"entry"`` (default) for an entry.
:>json datetime datetime: Specifies the datetime of the check-in. If not supplied, the current time will be used.
:>json boolean force: Specifies that the check-in should succeed regardless of revoked barcode, previous check-ins or required
questions that have not been filled. This is usually used to upload offline scans that already happened,
because there's no point in validating them since they happened whether they are valid or not. Defaults to ``false``.
:<json boolean questions_supported: When this parameter is set to ``true``, handling of questions is supported. If
:>json boolean questions_supported: When this parameter is set to ``true``, handling of questions is supported. If
you do not implement question handling in your user interface, you **must**
set this to ``false``. In that case, questions will just be ignored. Defaults
to ``true``.
:<json boolean ignore_unpaid: Specifies that the check-in should succeed even if the order is in pending state.
:>json boolean ignore_unpaid: Specifies that the check-in should succeed even if the order is in pending state.
Defaults to ``false`` and only works when ``include_pending`` is set on the check-in
list.
:<json object answers: If questions are supported/required, you may/must supply a mapping of question IDs to their
respective answers. The answers should always be strings. In case of (multiple-)choice-type
:>json object answers: If questions are supported/required, you may/must supply a mapping of ``identifier`` (`internal
reference`) of data fields to their respective answers (**NEW**).
For backwards compatibility, a mapping of data field ``id`` to answer is supported, as well.
The answers should always be strings. In case of (multiple-)choice-type
answers, the string should contain the (comma-separated) IDs of the selected options.
:<json string nonce: You can set this parameter to a unique random value to identify this check-in. If you're sending
:>json string nonce: You can set this parameter to a unique random value to identify this check-in. If you're sending
this request twice with the same nonce, the second request will also succeed but will always
create only one check-in object even when the previous request was successful as well. This
allows for a certain level of idempotency and enables you to re-try after a connection failure.
:<json string exchange_medium_type: To perform an exchange to a reusable medium, pass the type of the new reusable medium
:<json string exchange_medium_identifier: To perform an exchange to a reusable media, pass the identifier of the new medium
:<json boolean use_order_locale: Specifies that pretix should use the customer's language (``locale`` field from the
:>json string exchange_medium_type: To perform an exchange to a reusable medium, pass the type of the new reusable medium
:>json string exchange_medium_identifier: To perform an exchange to a reusable media, pass the identifier of the new medium
:>json boolean use_order_locale: Specifies that pretix should use the customer's language (``locale`` field from the
order) when building texts (currently only the ``reason_explanation`` response field).
Defaults to ``false`` in which case the server will determine the language (currently
the event default language, might change in the future with support for the
``Accept-Language`` header).
:<json boolean simulate: Do not actually perform the check-in, only simulate the response. The ``position`` response
:>json boolean simulate: Do not actually perform the check-in, only simulate the response. The ``position`` response
object will not reflect the simulated changes.
:>json string status: ``"ok"``, ``"incomplete"``, ``"exchange"``, or ``"error"``
:>json string reason: Reason code, only set on status ``"error"``, see below for possible values.
:>json string reason_explanation: Human-readable explanation, only set on status ``"error"`` and reason ``"rules"``, can be null.
:>json object position: Copy of the matching order position (if any was found). The contents are the same as the
:<json string status: ``"ok"``, ``"incomplete"``, ``"exchange"``, or ``"error"``
:<json string reason: Reason code, only set on status ``"error"``, see below for possible values.
:<json string reason_explanation: Human-readable explanation, only set on status ``"error"`` and reason ``"rules"``, can be null.
:<json object position: Copy of the matching order position (if any was found). The contents are the same as the
:ref:`order-position-resource`, with the following differences: (1) The ``checkins`` value
will only include check-ins for the selected list. (2) An additional boolean property
``require_attention`` will inform you whether either the order or the item have the
@@ -66,13 +76,13 @@ Checking a ticket in
back to values from a parent product or from invoice addresses. (4) Additional properties
``order__status``, ``order__valid_if_pending``, ``order__require_approval``, and
``order__locale`` are included with details form the order for convenience.
:>json boolean require_attention: Whether or not the ``require_attention`` flag is set on the item or order.
:>json list checkin_texts: List of additional texts to show to the user.
:>json object list: Excerpt of information about the matching :ref:`check-in list <rest-checkinlists>` (if any was found),
:<json boolean require_attention: Whether or not the ``require_attention`` flag is set on the item or order.
:<json list checkin_texts: List of additional texts to show to the user.
:<json object list: Excerpt of information about the matching :ref:`check-in list <rest-checkinlists>` (if any was found),
including the attributes ``id``, ``name``, ``event``, ``subevent``, and ``include_pending``.
:>json object questions: List of questions to be answered for check-in, only set on status ``"incomplete"``.
:>json object media_policy: Reusable media policy (see documentation on items), only set on status ``"exchange"``.
:>json object media_type: Reusable media type (see documentation on items), only set on status ``"exchange"``.
:<json object questions: List of questions to be answered for check-in, only set on status ``"incomplete"``.
:<json object media_policy: Reusable media policy (see documentation on items), only set on status ``"exchange"``.
:<json object media_type: Reusable media type (see documentation on items), only set on status ``"exchange"``.
**Example request**:
@@ -92,7 +102,7 @@ Checking a ticket in
"datetime": null,
"questions_supported": true,
"answers": {
"4": "XS"
"A1B2C3D4": "XS"
}
}
@@ -318,6 +328,7 @@ Performing a ticket search
],
"answers": [
{
"datafield": "A1B2C3D4",
"question": 12,
"answer": "Foo",
"options": []
+21 -10
View File
@@ -5,6 +5,14 @@
Check-in lists
==============
.. note::
This API is affected by an upcoming larger change to our API. The API documentation already reflects the future
version. Features or fields not yet available are marked with **NEW**.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
Resource description
--------------------
@@ -569,6 +577,7 @@ Order position endpoints
],
"answers": [
{
"datafield": "A1B2C3D4",
"question": 12,
"answer": "Foo",
"options": []
@@ -609,27 +618,29 @@ Order position endpoints
:query boolean untrusted_input: If set to true, the lookup parameter is **always** interpreted as a ``secret``, never
as an ``id``. This should be always set if you are passing through untrusted, scanned
data to avoid guessing of ticket IDs.
:<json boolean questions_supported: When this parameter is set to ``true``, handling of questions is supported. If
:>json boolean questions_supported: When this parameter is set to ``true``, handling of questions is supported. If
you do not implement question handling in your user interface, you **must**
set this to ``false``. In that case, questions will just be ignored. Defaults
to ``true``.
:<json boolean canceled_supported: When this parameter is set to ``true``, the response code ``canceled`` may be
:>json boolean canceled_supported: When this parameter is set to ``true``, the response code ``canceled`` may be
returned. Otherwise, canceled orders will return ``unpaid``. (**Deprecated**, in
the future, this will be ignored and ``canceled`` may always be returned.)
:<json datetime datetime: Specifies the datetime of the check-in. If not supplied, the current time will be used.
:<json boolean force: Specifies that the check-in should succeed regardless of revoked barcode, previous check-ins or required
:>json datetime datetime: Specifies the datetime of the check-in. If not supplied, the current time will be used.
:>json boolean force: Specifies that the check-in should succeed regardless of revoked barcode, previous check-ins or required
questions that have not been filled. This is usually used to upload offline scans that already happened,
because there's no point in validating them since they happened whether they are valid or not. Defaults to ``false``.
:<json string type: Send ``"exit"`` for an exit and ``"entry"`` (default) for an entry.
:<json boolean ignore_unpaid: Specifies that the check-in should succeed even if the order is in pending state.
:>json string type: Send ``"exit"`` for an exit and ``"entry"`` (default) for an entry.
:>json boolean ignore_unpaid: Specifies that the check-in should succeed even if the order is in pending state.
Defaults to ``false`` and only works when ``include_pending`` is set on the check-in
list.
:<json string nonce: You can set this parameter to a unique random value to identify this check-in. If you're sending
:>json string nonce: You can set this parameter to a unique random value to identify this check-in. If you're sending
this request twice with the same nonce, the second request will also succeed but will always
create only one check-in object even when the previous request was successful as well. This
allows for a certain level of idempotency and enables you to re-try after a connection failure.
:<json object answers: If questions are supported/required, you may/must supply a mapping of question IDs to their
respective answers. The answers should always be strings. In case of (multiple-)choice-type
:>json object answers: If questions are supported/required, you may/must supply a mapping of ``identifier`` (`internal
reference`) of data fields to their respective answers (**NEW**).
For backwards compatibility, a mapping of data field ``id`` to answer is supported, as well.
The answers should always be strings. In case of (multiple-)choice-type
answers, the string should contain the (comma-separated) IDs of the selected options.
**Example request**:
@@ -648,7 +659,7 @@ Order position endpoints
"questions_supported": true,
"canceled_supported": true,
"answers": {
"4": "XS"
"A1B2C3D4": "XS"
}
}
+250
View File
@@ -0,0 +1,250 @@
.. _rest-datafieldoptions:
Data field options
================
.. note::
This API is part of an upcoming larger change to our API. The API documentation already reflects the future
version. Until the change, this resource is still available at ``/questions/(id)/options/``.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
Resource description
--------------------
:ref:`Data fields <rest-datafields>` of type "choice" or "multiple choice" can have different options attached.
As with data fields, data field options exist on two resource paths, depending on whether
the data field is attached to orders or order positions. Therefore, each endpoint below has two
different URLs.
The options resource contains the following public fields:
.. rst-class:: rest-resource-table
===================================== ========================== =======================================================
Field Type Description
===================================== ========================== =======================================================
id integer Internal ID of the option
position integer An integer, used for sorting
identifier string An arbitrary string that can be used for matching with
other sources.
answer multi-lingual string The displayed value of this option
===================================== ========================== =======================================================
Endpoints
---------
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/
Returns a list of all options for a given data field.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/datafields/position/11/options/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
},
{
"id": 2,
"identifier": "DFEMJWMJ",
"position": 2,
"answer": {"en": "M"}
},
{
"id": 3,
"identifier": "W9AH7RDE",
"position": 3,
"answer": {"en": "L"}
}
]
}
:query integer page: The page number in case of a multi-page result set, default is 1
:query boolean active: If set to ``true`` or ``false``, only data fields with this value for the field ``active`` will be
returned.
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:param datafield: The ``id`` field of the data field to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event/data field does not exist **or** you have no permission to view this resource.
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/(id)/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/(id)/
Returns information on one option, identified by its ID.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:param datafield: The ``id`` field of the data field to fetch
:param id: The ``id`` field of the option to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/
Create a new option
**Example request**:
.. sourcecode:: http
POST /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
{
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
:param organizer: The ``slug`` field of the organizer of the event/data field to create a option for
:param event: The ``slug`` field of the event to create a option for
:param datafield: The ``id`` field of the data field to create a option for
:statuscode 201: no error
:statuscode 400: The option could not be created due to invalid submitted data.
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/(id)/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/(id)/
Update an option. You can also use ``PUT`` instead of ``PATCH``. With ``PUT``, you have to provide all fields of
the resource, other fields will be reset to default. With ``PATCH``, you only need to provide the fields that you
want to change.
You can change all fields of the resource except the ``id`` field.
**Example request**:
.. sourcecode:: http
PATCH /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
Content-Length: 94
{
"position": 3
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
:param organizer: The ``slug`` field of the organizer to modify
:param event: The ``slug`` field of the event to modify
:param id: The ``id`` field of the data field to modify
:param id: The ``id`` field of the option to modify
:statuscode 200: no error
:statuscode 400: The option could not be modified due to invalid submitted data
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(datafield)/options/(id)/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(datafield)/options/(id)/
Delete an option.
**Example request**:
.. sourcecode:: http
DELETE /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 204 No Content
Vary: Accept
:param organizer: The ``slug`` field of the organizer to modify
:param event: The ``slug`` field of the event to modify
:param datafield: The ``id`` field of the data field to modify
:param id: The ``id`` field of the option to delete
:statuscode 204: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
+428
View File
@@ -0,0 +1,428 @@
.. _rest-datafields:
Data fields
=========
.. note::
This API is part of an upcoming larger change to our API. The API documentation already reflects the future
version. Until the change, please keep using the endpoints at ``/questions/``.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
Resource description
--------------------
Data fields define additional fields related to an order or an order position.
By referencing data fields in a questionnaire, you can have customers or staff fill them out -- during or
after checkout (web or POS), during check-in in the ticket scanner app, or in the backend.
There are two different resource paths for data fields, depending on whether the data field is attached
to orders or order positions. Therefore, each endpoint below has two different URLs.
The data field resource contains the following public fields:
.. rst-class:: rest-resource-table
===================================== ========================== =======================================================
Field Type Description
===================================== ========================== =======================================================
id integer Internal ID of the data field
internal_name string **Required.** An internal field label
identifier string An arbitrary string that can be used for matching with
other sources.
Must be unique per event, across all types of data fields.
type string **Required.** The expected type of data. Valid options:
* ``N`` – number
* ``S`` – one-line string
* ``T`` – multi-line string
* ``B`` – boolean
* ``C`` – choice from a list
* ``M`` – multiple choice from a list
* ``F`` – file upload
* ``D`` – date
* ``H`` – time
* ``W`` – date and time
* ``CC`` – country code (ISO 3666-1 alpha-2)
* ``TEL`` – telephone number
show_during_checkin boolean If ``true``, the value of the data field will be shown
during check-in (if the check-in client supports it).
*Only supported on per-position data fields.*
print_on_invoice boolean If ``true``, the data field will be shown on
invoices.
*Only supported on per-position data fields.*
print_on_invoice_label multi-lingual string **Required if ``print_on_invoice`` is ``true``.** Label
to print on the invoice before the value of this field.
Otherwise `null`.
options list of objects In case of data field type ``C`` or ``M``, this lists the
available objects. Only writable during creation,
use :ref:`separate endpoint <rest-datafieldoptions>` to modify this later.
├ id integer Internal ID of the option
├ position integer An integer, used for sorting
├ identifier string An arbitrary string that can be used for matching with
other sources.
└ answer multi-lingual string The displayed value of this option
valid_number_min string Minimum value for number fields (optional)
valid_number_max string Maximum value for number fields (optional)
valid_date_min date Minimum value for date fields (optional)
valid_date_max date Maximum value for date fields (optional)
valid_datetime_min datetime Minimum value for date and time fields (optional)
valid_datetime_max datetime Maximum value for date and time fields (optional)
valid_file_portrait boolean Turn on file validation for portrait photos
valid_string_length_min integer Minimum length for string fields (optional)
valid_string_length_max integer Maximum length for string fields (optional)
referenced_by_questionnaires list of integers **Read-only.** List of questionnaire IDs that reference
this data field
===================================== ========================== =======================================================
Endpoints
---------
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/
Returns a list of all data fields within a given event.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/datafields/position/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"internal_name": "T-Shirt size",
"type": "C",
"identifier": "WY3TP9SL",
"show_during_checkin": false,
"print_on_invoice": false,
"print_on_invoice_label": null,
"valid_number_min": null,
"valid_number_max": null,
"valid_date_min": null,
"valid_date_max": null,
"valid_datetime_min": null,
"valid_datetime_max": null,
"valid_string_length_min": null,
"valid_string_length_max": null,
"valid_file_portrait": false,
"options": [
{
"id": 1,
"identifier": "LVETRWVU",
"position": 0,
"answer": {"en": "S"}
},
{
"id": 2,
"identifier": "DFEMJWMJ",
"position": 1,
"answer": {"en": "M"}
},
{
"id": 3,
"identifier": "W9AH7RDE",
"position": 2,
"answer": {"en": "L"}
}
],
"referenced_by_questionnaires": [1]
}
]
}
:query integer page: The page number in case of a multi-page result set, default is 1
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id`` and ``position``.
Default: ``position``
:query string identifier: Only return questions with the given identifier string
:query boolean ask_during_checkin: Only return questions that are or are not to be asked during check-in
:query boolean required: Only return questions that are or are not required to fill in
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(id)/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(id)/
Returns information on one data field, identified by its ID.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 1,
"internal_name": "T-Shirt size",
"type": "C",
"identifier": "WY3TP9SL",
"show_during_checkin": false,
"print_on_invoice": false,
"print_on_invoice_label": null,
"valid_number_min": null,
"valid_number_max": null,
"valid_date_min": null,
"valid_date_max": null,
"valid_datetime_min": null,
"valid_datetime_max": null,
"valid_string_length_min": null,
"valid_string_length_max": null,
"valid_file_portrait": false,
"options": [
{
"id": 1,
"identifier": "LVETRWVU",
"position": 0,
"answer": {"en": "S"}
},
{
"id": 2,
"identifier": "DFEMJWMJ",
"position": 1,
"answer": {"en": "M"}
},
{
"id": 3,
"identifier": "W9AH7RDE",
"position": 2,
"answer": {"en": "L"}
}
],
"referenced_by_questionnaires": [1]
}
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:param id: The ``id`` field of the question to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/
Create a new question
**Example request**:
.. sourcecode:: http
POST /api/v1/organizers/bigevents/events/sampleconf/datafields/position/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
{
"internal_name": "T-Shirt size",
"type": "C",
"show_during_checkin": false,
"print_on_invoice": false,
"print_on_invoice_label": null,
"options": [
{
"answer": {"en": "S"}
},
{
"answer": {"en": "M"}
},
{
"answer": {"en": "L"}
}
]
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"id": 1,
"internal_name": "T-Shirt size",
"type": "C",
"identifier": "WY3TP9SL",
"show_during_checkin": false,
"print_on_invoice": false,
"print_on_invoice_label": null,
"valid_number_min": null,
"valid_number_max": null,
"valid_date_min": null,
"valid_date_max": null,
"valid_datetime_min": null,
"valid_datetime_max": null,
"valid_string_length_min": null,
"valid_string_length_max": null,
"valid_file_portrait": false,
"options": [
{
"id": 1,
"identifier": "LVETRWVU",
"position": 0,
"answer": {"en": "S"}
},
{
"id": 2,
"identifier": "DFEMJWMJ",
"position": 1,
"answer": {"en": "M"}
},
{
"id": 3,
"identifier": "W9AH7RDE",
"position": 2,
"answer": {"en": "L"}
}
],
"referenced_by_questionnaires": [1]
}
:param organizer: The ``slug`` field of the organizer of the event to create an item for
:param event: The ``slug`` field of the event to create an item for
:statuscode 201: no error
:statuscode 400: The item could not be created due to invalid submitted data.
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(id)/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(id)/
Update a data field. You can also use ``PUT`` instead of ``PATCH``. With ``PUT``, you have to provide all fields of
the resource, other fields will be reset to default. With ``PATCH``, you only need to provide the fields that you
want to change.
You can change all fields of the resource except the ``options`` field. If
you need to update/delete options please use the nested dedicated endpoints.
**Example request**:
.. sourcecode:: http
PATCH /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
Content-Length: 94
{
"internal_name": "Clothing size"
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 1,
"internal_name": "Clothing size",
"type": "C",
"identifier": "WY3TP9SL",
"show_during_checkin": false,
"print_on_invoice": false,
"print_on_invoice_label": null,
"valid_number_min": null,
"valid_number_max": null,
"valid_date_min": null,
"valid_date_max": null,
"valid_datetime_min": null,
"valid_datetime_max": null,
"valid_string_length_min": null,
"valid_string_length_max": null,
"valid_file_portrait": false,
"options": [
{
"id": 1,
"identifier": "LVETRWVU",
"position": 0,
"answer": {"en": "S"}
},
{
"id": 2,
"identifier": "DFEMJWMJ",
"position": 1,
"answer": {"en": "M"}
},
{
"id": 3,
"identifier": "W9AH7RDE",
"position": 2,
"answer": {"en": "L"}
}
],
"referenced_by_questionnaires": [1]
}
:param organizer: The ``slug`` field of the organizer to modify
:param event: The ``slug`` field of the event to modify
:param id: The ``id`` field of the question to modify
:statuscode 200: no error
:statuscode 400: The question could not be modified due to invalid submitted data
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/datafields/position/(id)/
/api/v1/organizers/(organizer)/events/(event)/datafields/order/(id)/
Delete a data field.
**Example request**:
.. sourcecode:: http
DELETE /api/v1/organizers/bigevents/events/sampleconf/datafields/position/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 204 No Content
Vary: Accept
:param organizer: The ``slug`` field of the organizer to modify
:param event: The ``slug`` field of the event to modify
:param id: The ``id`` field of the question to delete
:statuscode 204: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
+3
View File
@@ -21,6 +21,9 @@ at :ref:`plugin-docs`.
item_add-ons
item_meta_properties
item_program_times
datafields
datafield_options
questionnaires
questions
question_options
quotas
+13 -5
View File
@@ -37,12 +37,9 @@ tax_rule integer The internal
admission boolean ``true`` for items that grant admission to the event
(such as primary tickets) and ``false`` for others
(such as add-ons or merchandise).
personalized boolean ``true`` for items that require personalization according
personalized boolean **DEPRECATED.** ``true`` for items that require personalization according
to event settings. Only affects system-level fields, not
custom questions. Currently only allowed for products with
``admission`` set to ``true``. For backwards compatibility,
when creating new items and this field is not given, it defaults
to the same value as ``admission``.
custom questions. Defaults to ``false``.
position integer An integer, used for sorting
picture file A product picture to be displayed in the shop
(can be ``null``).
@@ -233,6 +230,17 @@ meta_data object Values set fo
The ``program_times`` attribute has been added.
.. versionchanged:: 2027.1
The ``personalized`` attribute has been deprecated.
For compatibility with existing applications:
* When retrieving products, `personalized` is `True` if any attached questionnaire asks for `attendee_name` and/or `attendee_email`.
* When creating a new product, setting the `personalized` field to `True` will attach the "Attendee data" questionnaire to the new product. If no such questionnaire exists, it will be created.
Before, the `personalized` field defaulted to the same value as `admission`. Now, it defaults to `false`.
* When updating a product, the `personalized` field cannot be changed, returning an HTTP 400 error if attempted.
Notes
-----
+63 -12
View File
@@ -9,6 +9,14 @@
Orders
======
.. note::
This API is affected by an upcoming larger change to our API. The API documentation already reflects the future
version. Features or fields not yet available are marked with **NEW**.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
Order resource
--------------
@@ -119,6 +127,11 @@ cancellation_date datetime Time of order c
plugin_data object Additional data added by plugins.
use_gift_cards list of strings List of unique gift card secrets that are used to pay
for this order.
answers list of objects **NEW** Values of data fields (answers to user-defined questions)
├ datafield string The data field's ``identifier`` (internal reference)
├ answer string Text representation of the answer
├ options list of integers Internal IDs of selected option(s)s (only for choice types)
└ option_identifiers list of strings The ``identifier`` fields of the selected option(s)s
===================================== ========================== =======================================================
@@ -162,6 +175,10 @@ use_gift_cards list of strings List of unique
The ``use_gift_cards`` attribute has been added.
.. versionchanged:: 2027.1
The ``answers`` attribute has been added.
.. _order-position-resource:
Order position resource
@@ -231,12 +248,13 @@ print_logs list of objects List of print j
downloads list of objects List of ticket download options
├ output string Ticket output provider (e.g. ``pdf``, ``passbook``)
└ url string Download URL
answers list of objects Answers to user-defined questions
├ question integer Internal ID of the answered question
├ answer string Text representation of the answer (URL if answer is a file)
├ question_identifier string The question's ``identifier`` field
answers list of objects Values of data fields (answers to user-defined questions)
├ datafield string **NEW** The data field's ``identifier`` (internal reference)
├ answer string Text representation of the answer
├ options list of integers Internal IDs of selected option(s)s (only for choice types)
└ option_identifiers list of strings The ``identifier`` fields of the selected option(s)s
├ option_identifiers list of strings The ``identifier`` fields of the selected option(s)s
├ question integer **Deprecated.** Internal ID of the data field
└ question_identifier string **Read-only, deprecated.** The data field's ``identifier`` (internal reference)
seat objects The assigned seat. Can be ``null``.
├ id integer Internal ID of the seat instance
├ name string Human-readable seat name
@@ -452,10 +470,11 @@ List of all orders
],
"answers": [
{
"datafield": "WY3TP9SL",
"question": 12,
"question_identifier": "WY3TP9SL",
"answer": "Foo",
"option_idenfiters": [],
"option_identifiers": [],
"options": []
}
],
@@ -488,7 +507,15 @@ List of all orders
],
"refunds": [],
"cancellation_date": null,
"plugin_data": {}
"plugin_data": {},
"answers": [
{
"datafield": "XYZ12345",
"answer": "42",
"option_identifiers": [],
"options": []
}
]
}
]
}
@@ -699,6 +726,7 @@ Fetching individual orders
],
"answers": [
{
"datafield": "WY3TP9SL",
"question": 12,
"question_identifier": "WY3TP9SL",
"answer": "Foo",
@@ -735,7 +763,15 @@ Fetching individual orders
],
"refunds": [],
"cancellation_date": null,
"plugin_data": {}
"plugin_data": {},
"answers": [
{
"datafield": "XYZ12345",
"answer": "42",
"option_identifiers": [],
"options": []
}
]
}
:param organizer: The ``slug`` field of the organizer to fetch
@@ -1079,7 +1115,8 @@ Creating orders
* ``discount`` (optional, only possible if ``price`` is set; attention: if this is set to not-``null`` on any position, automatic calculation of discounts will not run)
* ``answers``
* ``question``
* ``datafield`` (**NEW**)
* ``question`` (**DEPRECATED**)
* ``answer``
* ``options``
@@ -1114,6 +1151,12 @@ Creating orders
order isn't completely paid after its creation with ``use_gift_cards``, then a subsequent request to the payment
endpoint is needed.
* **NEW** ``answers`` (optional). Values for order-level data fields.
* ``datafield``
* ``answer``
* ``options``
If you want to use add-on products, you need to set the ``positionid`` fields of all positions manually
to incrementing integers starting with ``1``. Then, you can reference one of these
IDs in the ``addon_to`` field of another position. Note that all add_ons for a specific position need to come
@@ -1161,6 +1204,12 @@ Creating orders
"internal_reference": "",
"vat_id": ""
},
"answers": [
{
"datafield": "XYZ12345",
"answer": "42"
}
],
"positions": [
{
"positionid": 1,
@@ -1174,7 +1223,7 @@ Creating orders
"addon_to": null,
"answers": [
{
"question": 1,
"datafield": "WY3TP9SL",
"answer": "23",
"options": []
}
@@ -1684,6 +1733,7 @@ List of all order positions
],
"answers": [
{
"datafield": "WY3TP9SL",
"question": 12,
"question_identifier": "WY3TP9SL",
"answer": "Foo",
@@ -1863,6 +1913,7 @@ Fetching individual positions
],
"answers": [
{
"datafield": "WY3TP9SL",
"question": 12,
"question_identifier": "WY3TP9SL",
"answer": "Foo",
@@ -1971,7 +2022,7 @@ Manipulating individual positions
* ``answers``: If specified, you will need to provide **all** answers for this order position.
Validation is handled the same way as when creating orders through the API. You are therefore
expected to provide ``question``, ``answer``, and possibly ``options``. ``question_identifier``
expected to provide ``datafield``, ``answer``, and possibly ``options``. ``question`` is deprecated. ``question_identifier``
and ``option_identifiers`` will be ignored. As a special case, you can submit the magic value
``"file:keep"`` as the answer to a file question to keep the current value without re-uploading it.
@@ -2067,7 +2118,7 @@ Manipulating individual positions
* ``state``
* ``answers``: Validation is handled the same way as when creating orders through the API. You are therefore
expected to provide ``question``, ``answer``, and possibly ``options``. ``question_identifier``
expected to provide ``datafield``, ``answer``, and possibly ``options``. ``question`` is deprecated. ``question_identifier``
and ``option_identifiers`` will be ignored. As a special case, you can submit the magic value
``"file:keep"`` as the answer to a file question to keep the current value without re-uploading it.
+2 -224
View File
@@ -1,229 +1,7 @@
Question options
================
Resource description
--------------------
.. warning:: This resource is **deprecated**.
Questions of type "choice" or "multiple choice" can have different options attached.
The options resource contains the following public fields:
New applications must use the :ref:`rest-datafieldoptions` resource.
.. rst-class:: rest-resource-table
===================================== ========================== =======================================================
Field Type Description
===================================== ========================== =======================================================
id integer Internal ID of the option
position integer An integer, used for sorting
identifier string An arbitrary string that can be used for matching with
other sources.
answer multi-lingual string The displayed value of this option
===================================== ========================== =======================================================
Endpoints
---------
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/
Returns a list of all options for a given question.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/questions/11/options/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
},
{
"id": 2,
"identifier": "DFEMJWMJ",
"position": 2,
"answer": {"en": "M"}
},
{
"id": 3,
"identifier": "W9AH7RDE",
"position": 3,
"answer": {"en": "L"}
}
]
}
:query integer page: The page number in case of a multi-page result set, default is 1
:query boolean active: If set to ``true`` or ``false``, only questions with this value for the field ``active`` will be
returned.
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:param question: The ``id`` field of the question to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event/question does not exist **or** you have no permission to view this resource.
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/(id)/
Returns information on one option, identified by its ID.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:param question: The ``id`` field of the question to fetch
:param id: The ``id`` field of the option to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/
Creates a new option
**Example request**:
.. sourcecode:: http
POST /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
{
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
:param organizer: The ``slug`` field of the organizer of the event/question to create a option for
:param event: The ``slug`` field of the event to create a option for
:param question: The ``id`` field of the question to create a option for
:statuscode 201: no error
:statuscode 400: The option could not be created due to invalid submitted data.
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/questions/(question)/options/(id)/
Update an option. You can also use ``PUT`` instead of ``PATCH``. With ``PUT``, you have to provide all fields of
the resource, other fields will be reset to default. With ``PATCH``, you only need to provide the fields that you
want to change.
You can change all fields of the resource except the ``id`` field.
**Example request**:
.. sourcecode:: http
PATCH /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
Content-Length: 94
{
"position": 3
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 1,
"identifier": "LVETRWVU",
"position": 1,
"answer": {"en": "S"}
}
:param organizer: The ``slug`` field of the organizer to modify
:param event: The ``slug`` field of the event to modify
:param id: The ``id`` field of the question to modify
:param id: The ``id`` field of the option to modify
:statuscode 200: no error
:statuscode 400: The option could not be modified due to invalid submitted data
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/questions/(id)/options/(id)/
Delete an option.
**Example request**:
.. sourcecode:: http
DELETE /api/v1/organizers/bigevents/events/sampleconf/questions/1/options/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 204 No Content
Vary: Accept
:param organizer: The ``slug`` field of the organizer to modify
:param event: The ``slug`` field of the event to modify
:param id: The ``id`` field of the question to modify
:param id: The ``id`` field of the option to delete
:statuscode 204: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
+379
View File
@@ -0,0 +1,379 @@
.. _rest-questionnaires:
Questionnaires
=========
.. note::
This API is part of an upcoming larger change to our API. The API documentation already reflects the future
version. Until the change, please keep using the endpoints at ``/questions/``.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
Questionnaires are attached to one or more products, and a product can have multiple questionnaires.
They consist of questionnaire rows, each of which can be one of the following:
Reference to system field
To reference a system field, use one of the identifier strings from the table below in the row's `datafield` attribute.
Currently, system fields are only defined on order positions, not on orders.
=============== =========================== ============================
Container Identifier Label
=============== =========================== ============================
Order position `"@attendee_name_parts"` Attendee name
Order position `"@attendee_email"` Attendee email
Order position `"@company"` Company
Order position `"@street"` Street
Order position `"@zipcode"` ZIP code
Order position `"@city"` City
Order position `"@state"` State
Order position `"@country"` Country
=============== =========================== ============================
Reference to user-defined data field
To reference a :ref:`user-defined data field <rest-datafields>`, use its internal reference (`identifier`)
in the row's `datafield` attribute.
Static explanation text / subheading
To add a static text block, set the row's `datafield` attribute to `null`. In this case, the text
from the `label` attribute is displayed as a subheading, and the `help_text` attribute as a normal paragraph.
Resource description
--------------------
.. rst-class:: rest-resource-table
===================================== ========================== =======================================================
Field Type Description
===================================== ========================== =======================================================
id integer Internal ID of the questionnaire
type string The type of questionnaire. Valid options:
* ``order_purchase`` — Order-wide, before purchase
* ``position_purchase`` — Per product, before purchase
* ``position_attendee`` — Per product, via attendee link
* ``position_checkin`` — Per product, at check-in
* ``position_hidden`` — Per product, hidden
internal_name string Internal label for the questionnaire.
items list of integers List of item IDs this questionnaire is assigned to.
*Only supported on per-product questionnaires.*
position integer An integer, used for sorting
all_sales_channels boolean If ``true`` (default), the questions from this questionnaire
are asked on all sales channels.
limit_sales_channels list of strings List of sales channel identifiers the questions are asked on
if ``all_sales_channels`` is ``false``.
rows list of objects List of all questionnaire rows.
├ datafield string Reference to a data field (see above)
├ required boolean If ``true``, the question needs to be filled out.
├ label multi-lingual string The field label shown to the customer. In case of a static
text block, the subheading.
├ help_text multi-lingual string The help text shown to the customer.
├ dependency_datafield string ``datafield`` reference of a different row in the same
questionnaire.
The current question will only be shown if the question
given in this attribute is set to one of the values given
in ``dependency_values``.
├ dependency_values list of strings If ``dependency_datafield`` is set to reference a boolean
data field, this should be ``["True"]`` or ``["False"]``.
Otherwise, it should be a list of ``identifier`` values
of question options.
├ rendered_help_text string **Read-only.** Markdown contents from help_text rendered
to HTML
===================================== ========================== =======================================================
Endpoints
---------
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questionnaires/
Returns a list of all questionnaires within a given event.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/questionnaires/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"type": "position_purchase",
"internal_name": "Attendee data",
"items": [1, 2],
"position": 0,
"all_sales_channels": true,
"limit_sales_channels": [],
"rows": [
{
"datafield": "@attendee_name_parts",
"required": false,
"label": {"en": "Attendee name"},
"help_text": {},
"dependency_datafield": null,
"dependency_values": [],
"rendered_help_text": ""
},
{
"datafield": "@attendee_email",
"required": false,
"label": {"en": "Attendee email"},
"help_text": {"en": "*We'll send you our program guide a few days before the event.*"},
"dependency_datafield": null,
"dependency_values": [],
"rendered_help_text": "<em>We'll send you our program guide a few days before the event.</em>"
}
]
},
{
"id": 2,
"type": "order_purchase",
"internal_name": "Per-order questions",
"items": [],
"position": 0,
"all_sales_channels": true,
"limit_sales_channels": [],
"rows": [
{
"datafield": "87Y8DCS9",
"required": false,
"label": {"en": "How did you find us?"},
"help_text": {},
"dependency_datafield": null,
"dependency_values": [],
"rendered_help_text": ""
}
]
}
]
}
:query integer page: The page number in case of a multi-page result set, default is 1
:query string ordering: Manually set the ordering of results. Valid fields to be used are ``id`` and ``position``.
Default: ``position``
:query string type: Only return questionnaires with the given type
:query string items: Only return questionnaires associated with the given item (internal item ID)
:query boolean sales_channel: Only return questionnaires visible on the given sales channel (sales channel identifier string)
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
.. http:get:: /api/v1/organizers/(organizer)/events/(event)/questionnaires/(id)/
Returns information on one questionnaire, identified by its ID.
**Example request**:
.. sourcecode:: http
GET /api/v1/organizers/bigevents/events/sampleconf/questionnaires/2/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 2,
"type": "order_purchase",
"internal_name": "Per-order questions",
"items": [],
"position": 0,
"all_sales_channels": true,
"limit_sales_channels": [],
"rows": [
{
"datafield": "87Y8DCS9",
"required": false,
"label": {"en": "How did you find us?"},
"help_text": {},
"dependency_datafield": null,
"dependency_values": [],
"rendered_help_text": ""
}
]
}
:param organizer: The ``slug`` field of the organizer to fetch
:param event: The ``slug`` field of the event to fetch
:param id: The ``id`` field of the questionnaire to fetch
:statuscode 200: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to view this resource.
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/questionnaires/
Create a new questionnaire
**Example request**:
.. sourcecode:: http
POST /api/v1/organizers/bigevents/events/sampleconf/questionnaires/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
{
"type": "order_purchase",
"internal_name": "Per-order questions",
"position": 0,
"all_sales_channels": true,
"rows": [
{
"datafield": "87Y8DCS9",
"required": false,
"label": {"en": "How did you find us?"}
}
]
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 201 Created
Vary: Accept
Content-Type: application/json
{
"id": 2,
"type": "order_purchase",
"internal_name": "Per-order questions",
"items": [],
"position": 0,
"all_sales_channels": true,
"limit_sales_channels": [],
"rows": [
{
"datafield": "87Y8DCS9",
"required": false,
"label": {"en": "How did you find us?"},
"help_text": {},
"dependency_datafield": null,
"dependency_values": [],
"rendered_help_text": ""
}
]
}
:param organizer: The ``slug`` field of the organizer of the event to create a questionnaire for
:param event: The ``slug`` field of the event to create a questionnaire for
:statuscode 201: no error
:statuscode 400: The questionnaire could not be created due to invalid submitted data.
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to create this resource.
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/questionnaires/(id)/
Update a questionnaire. You can also use ``PUT`` instead of ``PATCH``. With ``PUT``, you have to provide all fields of
the resource, other fields will be reset to default. With ``PATCH``, you only need to provide the fields that you
want to change.
You can only change all ``rows`` en bloc, or keep all of them unchanged in case of a ``PATCH``. If you
change ``rows``, you need to specify all fields of the resource.
**Example request**:
.. sourcecode:: http
PATCH /api/v1/organizers/bigevents/events/sampleconf/questionnaires/2/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
Content-Type: application/json
{
"internal_name": "Questions asked per order"
}
**Example response**:
.. sourcecode:: http
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
{
"id": 2,
"type": "order_purchase",
"internal_name": "Questions asked per order",
"items": [],
"position": 0,
"all_sales_channels": true,
"limit_sales_channels": [],
"rows": [
{
"datafield": "87Y8DCS9",
"required": false,
"label": {"en": "How did you find us?"},
"help_text": {},
"dependency_datafield": null,
"dependency_values": [],
"rendered_help_text": ""
}
]
}
:param organizer: The ``slug`` field of the organizer of the questionnaire to modify
:param event: The ``slug`` field of the event of the questionnaire to modify
:param id: The ``id`` field of the questionnaire to modify
:statuscode 200: no error
:statuscode 400: The questionnaire could not be modified due to invalid submitted data
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to change this resource.
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/questionnaires/(id)/
Delete a questionnaire.
**Example request**:
.. sourcecode:: http
DELETE /api/v1/organizers/bigevents/events/sampleconf/questionnaires/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript
**Example response**:
.. sourcecode:: http
HTTP/1.1 204 No Content
Vary: Accept
:param organizer: The ``slug`` field of the organizer of the questionnaire to modify
:param event: The ``slug`` field of the event of the questionnaire to modify
:param id: The ``id`` field of the questionnaire to delete
:statuscode 204: no error
:statuscode 401: Authentication failure
:statuscode 403: The requested organizer/event does not exist **or** you have no permission to delete this resource.
+40 -1
View File
@@ -8,10 +8,23 @@
Questions
=========
.. warning:: This resource is **deprecated**. It is only provided for compatibility with existing applications
and should not be used in new development.
New applications must use the :ref:`rest-datafields` and :ref:`rest-questionnaires` resources.
The new version is expected to be released for hosted pretix early December and for self-hosted pretix with
version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
This resource will continue to work in read-only mode on events where the
:ref:`questionnaire configuration <rest-questionnaires>` is compatible with the old data model.
If incompatible configuration is detected, all endpoints return HTTP 410.
Resource description
--------------------
Questions define additional fields that need to be filled out by customers during checkout.
Questions define additional fields related to an order position that need to be filled out by customers during checkout.
The question resource contains the following public fields:
.. rst-class:: rest-resource-table
@@ -84,6 +97,10 @@ dependency_value string An old version
The ``show_during_checkin`` attribute has been added.
.. versionchanged:: 2026.[TODO]
The questions resource was deprecated and replaced by the :ref:`rest-datafields` and :ref:`rest-questionnaires` resources.
Endpoints
---------
@@ -249,6 +266,13 @@ Endpoints
.. http:post:: /api/v1/organizers/(organizer)/events/(event)/questions/
.. warning:: This endpoint is **deprecated** and will be removed as part of an upcoming API change.
The new version is expected to be released for hosted pretix early December and for self-hosted
pretix with version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
After the change, instead create a :ref:`data field <rest-datafields>` first, then add
it to a :ref:`questionnaire <rest-questionnaires>`.
Creates a new question
**Example request**:
@@ -351,6 +375,13 @@ Endpoints
.. http:patch:: /api/v1/organizers/(organizer)/events/(event)/questions/(id)/
.. warning:: This endpoint is **deprecated** and will be removed as part of an upcoming API change.
The new version is expected to be released for hosted pretix early December and for self-hosted
pretix with version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
After the change, instead update the relevant :ref:`data field <rest-datafields>`, or
the reference to it inside a :ref:`questionnaire <rest-questionnaires>`.
Update a question. You can also use ``PUT`` instead of ``PATCH``. With ``PUT``, you have to provide all fields of
the resource, other fields will be reset to default. With ``PATCH``, you only need to provide the fields that you
want to change.
@@ -437,6 +468,14 @@ Endpoints
.. http:delete:: /api/v1/organizers/(organizer)/events/(event)/questions/(id)/
.. warning:: This endpoint is **deprecated** and will be removed as part of an upcoming API change.
The new version is expected to be released for hosted pretix early December and for self-hosted
pretix with version 2027.1.
You can find more information `on our blog <https://pretix.eu/about/en/blog/20261110-questionnaires/>`_.
After the change, insteadremove the questionnaire child from its :ref:`questionnaire <rest-questionnaires>`,
or delete the relevant :ref:`data field <rest-datafields>`.
Delete a question.
**Example request**:
+1 -1
View File
@@ -1,6 +1,6 @@
sphinx==9.0.*
sphinx-rtd-theme~=3.1.0
sphinxcontrib-httpdomain~=2.1.0
sphinxcontrib-httpdomain~=2.2.1
sphinxcontrib-images~=1.0.1
sphinxcontrib-jquery~=4.1
sphinxcontrib-spelling~=8.0.2
+1 -1
View File
@@ -1,7 +1,7 @@
-e ../
sphinx==9.0.*
sphinx-rtd-theme~=3.1.0
sphinxcontrib-httpdomain~=2.1.0
sphinxcontrib-httpdomain~=2.2.1
sphinxcontrib-images~=1.0.1
sphinxcontrib-jquery~=4.1
sphinxcontrib-spelling~=8.0.2
+1 -2
View File
@@ -80,8 +80,7 @@ dependencies = [
"psycopg2-binary",
"pycountry",
"pycparser==3.12",
"pycryptodome==3.24.*",
"pypdf==6.20.*",
"pypdf==6.21.*",
"python-bidi==0.6.*", # Support for Arabic in reportlab
"python-dateutil==4.0.*",
"pytz",
+8
View File
@@ -156,6 +156,8 @@ class ExportFormDataField(serializers.Field):
return JobRunSerializer(exporter=exporter).to_internal_value(data["export_form_data"])
else:
return data['export_form_data']
else: # partial PATCH without export_form_data keeps it unchanged
return self.parent.instance.export_form_data
class ScheduledExportSerializer(serializers.ModelSerializer):
@@ -188,6 +190,12 @@ class ScheduledExportSerializer(serializers.ModelSerializer):
raise ValidationError('Please enter less than 25 recipients.')
return d
def validate(self, attrs):
attrs = super().validate(attrs)
if self.instance and self.instance.pk and 'export_identifier' in attrs and self.instance.export_identifier != attrs['export_identifier']:
raise ValidationError({"export_identifier": "export_identifier cannot be changed for existing exports."})
return attrs
class ScheduledEventExportSerializer(ScheduledExportSerializer):
+2
View File
@@ -197,6 +197,8 @@ class ReusableMediaSerializer(I18nAwareModelSerializer):
'linked_giftcard',
'info',
'notes',
# When adding fields, check if they should be hidden in ReusableMediaViewSet
# for cross-organizer lookups
)
+1
View File
@@ -117,6 +117,7 @@ class TransmissionInfoSerializer(serializers.Serializer):
super().__init__(*args, **kwargs)
for k, v in transmission_type.invoice_address_form_fields.items():
self.fields[k] = form_field_to_serializer_field(v)
self.fields[k].required = False # invoice_address_form_fields_required is checked by parent serializer
class InvoiceAddressSerializer(I18nAwareModelSerializer):
+42 -31
View File
@@ -272,6 +272,8 @@ class ScheduledEventExportViewSet(ScheduledExportersViewSet):
perm_holder = self.request.auth if isinstance(self.request.auth, (TeamAPIToken, Device)) else self.request.user
if not perm_holder.has_event_permission(self.request.organizer, self.request.event, exporter.get_required_event_permission()):
raise PermissionDenied("No permission to edit exports you could not run.")
# An additional check for the new config, such as on organizer level, is not necessary. Since the event is
# fixed and the export_identifier is read-only, the update cannot include a meaningful change of permissions.
serializer.save(event=self.request.event)
serializer.instance.compute_next_run()
@@ -344,6 +346,40 @@ class ScheduledOrganizerExportViewSet(ScheduledExportersViewSet):
))
return {e.identifier: e for e in exporters}
def _check_permission_for_export(self, identifier, form_data):
perm_holder = (
self.request.auth if isinstance(self.request.auth, (Device, TeamAPIToken)) else self.request.user
)
exporter = self.exporters.get(identifier)
if not exporter:
raise PermissionDenied("No access to exporter.")
if isinstance(exporter, OrganizerLevelExportMixin):
if not perm_holder.has_organizer_permission(
self.request.organizer, exporter.get_required_organizer_permission(), request=self.request,
):
raise PermissionDenied("No permission to edit exports you could not run.")
else:
if form_data.get("all_events", False):
if isinstance(self.request.auth, Device):
if not self.request.auth.all_events:
raise PermissionDenied("No permission to edit exports you could not run.")
elif isinstance(self.request.auth, TeamAPIToken):
if not self.request.auth.team.all_events:
raise PermissionDenied("No permission to edit exports you could not run.")
elif self.request.user.is_authenticated:
if not self.request.user.teams.filter(
TeamQuerySet.event_permission_q(exporter.get_required_event_permission()),
all_events=True,
).exists():
raise PermissionDenied("No permission to edit exports you could not run.")
else:
events_selected = form_data.get("events", [])
events_permission = set(perm_holder.get_events_with_permission(
exporter.get_required_event_permission(), request=self.request
).values_list("pk", flat=True))
if not all(e in events_permission for e in events_selected):
raise PermissionDenied("No permission to edit exports you could not run.")
@transaction.atomic()
def perform_update(self, serializer):
if not self.request.user.is_authenticated or self.request.user != serializer.instance.owner:
@@ -351,37 +387,12 @@ class ScheduledOrganizerExportViewSet(ScheduledExportersViewSet):
# user B has settings permission (= they can see the export configuration), but not enough permission
# to run the export themselves. Without this check, user B could modify the export and add themselves
# as a recipient. Thereby, user B would gain access to data they can't have.
exporter = self.exporters.get(serializer.instance.export_identifier)
if not exporter:
raise PermissionDenied("No access to exporter.")
perm_holder = (self.request.auth if isinstance(self.request.auth, (Device, TeamAPIToken))
else self.request.user)
if isinstance(exporter, OrganizerLevelExportMixin):
if not perm_holder.has_organizer_permission(
self.request.organizer, exporter.get_required_organizer_permission(), request=self.request,
):
raise PermissionDenied("No permission to edit exports you could not run.")
else:
if serializer.instance.export_form_data.get("all_events", False):
if isinstance(self.request.auth, Device):
if not self.request.auth.all_events:
raise PermissionDenied("No permission to edit exports you could not run.")
elif isinstance(self.request.auth, TeamAPIToken):
if not self.request.auth.team.all_events:
raise PermissionDenied("No permission to edit exports you could not run.")
elif self.request.user.is_authenticated:
if not self.request.user.teams.filter(
TeamQuerySet.event_permission_q(exporter.get_required_event_permission()),
all_events=True,
).exists():
raise PermissionDenied("No permission to edit exports you could not run.")
else:
events_selected = serializer.instance.export_form_data.get("events", [])
events_permission = set(perm_holder.get_events_with_permission(
exporter.get_required_event_permission(), request=self.request
).values_list("pk", flat=True))
if not all(e in events_permission for e in events_selected):
raise PermissionDenied("No permission to edit exports you could not run.")
self._check_permission_for_export(serializer.instance.export_identifier, serializer.instance.export_form_data)
# After we checked that the API user can work with the original export, we also need to check that they can
# work with the changed export, otherwise they could change e.g. from "some events" to "all events" and add
# themselves as a recipient.
if serializer.validated_data.get('export_form_data') is not None:
self._check_permission_for_export(serializer.instance.export_identifier, serializer.validated_data['export_form_data'])
serializer.save(organizer=self.request.organizer)
serializer.instance.compute_next_run()
+11 -2
View File
@@ -183,9 +183,18 @@ class ReusableMediaViewSet(viewsets.ModelViewSet):
type=s.validated_data["type"],
identifier=s.validated_data["identifier"],
)
m.customer = None # not relevant for cross-organizer
s = self.get_serializer(m)
return Response({"result": s.data})
data = s.data
# Remove fields that are not relevant for cross-organizer usage
data["customer"] = None
data["linked_orderposition"] = None
data["linked_orderpositions"] = []
data["info"] = {}
data["notes"] = None
data["claim_token"] = None
data["label"] = None
return Response({"result": data})
except ReusableMedium.DoesNotExist:
mt = MEDIA_TYPES.get(s.validated_data["type"])
if mt:
+3 -3
View File
@@ -29,6 +29,7 @@ from typing import List, Optional, Protocol
from django.conf import settings
from django.db import DatabaseError, transaction
from django.utils.functional import classproperty
from django.utils.timezone import now
from django.utils.translation import gettext_lazy as _
@@ -101,9 +102,8 @@ class OutboundSyncProvider:
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()
@classmethod
@property
def display_name(cls):
@classproperty
def display_name(cls): # noqa: N805
return str(cls.identifier)
@classmethod
@@ -23,6 +23,7 @@
<link rel="manifest" href="{% url "site.webmanifest" %}">
<link rel="mask-icon" href="{% static "pretixbase/img/icons/safari-pinned-tab.svg" %}" color="#3b1c4a">
<meta name="theme-color" content="#3b1c4a">
<script type="text/javascript" src="{% static "pretixbase/js/csrfcookieretry.js" %}"></script>
</head>
<body>
<div class="container">
@@ -44,7 +44,7 @@
{% endblocktrans %}
</div>
{% endif %}
{% if not request.event.has_subevents and object.hidden_if_item_available and object.hidden_if_item_available.check_quotas.0 == 100 %}
{% if not request.event.has_subevents and object.hidden_if_item_available and object.hidden_if_item_available.check_quotas.0 == 100 and object.hidden_if_item_available.is_available %}
<div class="alert alert-warning">
{% blocktrans trimmed %}
This product is currently not being shown since you configured below that it should only be visible
+15 -5
View File
@@ -2124,7 +2124,7 @@ class ExportView(OrganizerPermissionRequiredMixin, ExportMixin, ListView):
@transaction.atomic()
def post(self, request, *args, **kwargs):
if request.POST.get("schedule") == "save":
if self.scheduled and self.scheduled.pk and not self.has_permission_to_edit_scheduled():
if self.scheduled and self.scheduled.pk and not self.has_permission_to_edit_scheduled(self.scheduled.export_form_data):
messages.error(
self.request,
_(
@@ -2143,6 +2143,16 @@ class ExportView(OrganizerPermissionRequiredMixin, ExportMixin, ListView):
)
return super().get(request, *args, **kwargs)
elif self.exporter.form.is_valid() and self.rrule_form.is_valid() and self.schedule_form.is_valid():
if self.scheduled and self.scheduled.pk and not self.has_permission_to_edit_scheduled(self.exporter.form.cleaned_data):
messages.error(
self.request,
_(
"This report runs with the permissions of a different user and you do not have access to all "
"events, therefore you cannot change it to cover additional events."
)
)
return super().get(request, *args, **kwargs)
self.schedule_form.instance.export_identifier = self.exporter.identifier
self.schedule_form.instance.export_form_data = self.exporter.form.cleaned_data
self.schedule_form.instance.schedule_rrule = str(self.rrule_form.to_rrule())
@@ -2224,7 +2234,7 @@ class ExportView(OrganizerPermissionRequiredMixin, ExportMixin, ListView):
def get_queryset(self):
return self.get_scheduled_queryset()
def has_permission_to_edit_scheduled(self):
def has_permission_to_edit_scheduled(self, export_form_data):
# Exports can be edited by
# - their owner
# - any staff session user
@@ -2249,7 +2259,7 @@ class ExportView(OrganizerPermissionRequiredMixin, ExportMixin, ListView):
self.request.organizer, self.exporter.get_required_organizer_permission(), request=self.request
)
else:
if self.scheduled.export_form_data.get("all_events", False):
if export_form_data.get("all_events", False):
# Test scenario 1/2 in test_organizer_edit_restrictions
return self.request.user.teams.filter(
TeamQuerySet.event_permission_q(self.exporter.get_required_event_permission()),
@@ -2257,7 +2267,7 @@ class ExportView(OrganizerPermissionRequiredMixin, ExportMixin, ListView):
).exists()
else:
# Test scenario 3/4 in test_organizer_edit_restrictions
events_selected = self.scheduled.export_form_data.get("events", [])
events_selected = export_form_data.get("events", [])
events_permission = set(self.request.user.get_events_with_permission(
self.exporter.get_required_event_permission(), request=self.request,
).values_list("pk", flat=True))
@@ -2285,7 +2295,7 @@ class ExportView(OrganizerPermissionRequiredMixin, ExportMixin, ListView):
ctx['rrule_form'] = self.rrule_form
ctx['scheduled_copy_from'] = self.scheduled_copy_from
if self.scheduled and self.scheduled.pk and not self.has_permission_to_edit_scheduled() and self.exporter:
if self.scheduled and self.scheduled.pk and not self.has_permission_to_edit_scheduled(self.scheduled.export_form_data) and self.exporter:
ctx['no_save'] = True
for f in self.exporter.form.fields.values():
f.disabled = True
+6 -7
View File
@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: 1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-10-28 10:48+0000\n"
"PO-Revision-Date: 2026-10-28 11:13+0000\n"
"PO-Revision-Date: 2026-11-06 22:00+0000\n"
"Last-Translator: Raphael Michel <michel@rami.io>\n"
"Language-Team: German <https://translate.pretix.eu/projects/pretix/pretix/"
"de/>\n"
@@ -14,7 +14,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2026.10.1\n"
"X-Generator: Weblate 2026.11.1\n"
"X-Poedit-Bookmarks: -1,-1,904,-1,-1,-1,-1,-1,-1,-1\n"
#: pretix/_base_settings.py
@@ -12572,17 +12572,16 @@ msgid ""
msgstr ""
"Hallo {name},\n"
"\n"
"vielen Dank für Ihre Anmeldung für ein Kundenkonto bei {organizer}!\n"
"Sie haben angefragt, Ihre E-Mail-Adresse für Ihr Kundenkonto bei {organizer} "
"zu ändern.\n"
"\n"
"Um Ihr Kundenkonto zu aktivieren und ein Passwort zu wählen, klicken Sie "
"bitte hier:\n"
"Um dies zu bestätigen, klicken Sie bitte hier:\n"
"\n"
"{url}\n"
"\n"
"Dieser Link ist gültig für einen Tag.\n"
"\n"
"Wenn Sie sich nicht selbst angemeldet haben, können Sie diese E-Mail "
"ignorieren.\n"
"Wenn Sie dies nicht angefragt haben, können Sie diese E-Mail ignorieren.\n"
"\n"
"Viele Grüße\n"
"\n"
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: 1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-10-28 10:48+0000\n"
"PO-Revision-Date: 2026-10-28 11:13+0000\n"
"PO-Revision-Date: 2026-11-06 22:00+0000\n"
"Last-Translator: Raphael Michel <michel@rami.io>\n"
"Language-Team: German (informal) <https://translate.pretix.eu/projects/"
"pretix/pretix/de_Informal/>\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2026.10.1\n"
"X-Generator: Weblate 2026.11.1\n"
#: pretix/_base_settings.py
msgid "English"
@@ -12552,17 +12552,16 @@ msgid ""
msgstr ""
"Hallo {name},\n"
"\n"
"vielen Dank für deine Anmeldung für ein Kundenkonto bei {organizer}!\n"
"du hast angefragt, die E-Mail-Adresse für dein Kundenkonto bei {organizer} "
"zu ändern.\n"
"\n"
"Um dein Kundenkonto zu aktivieren und ein Passwort zu wählen, klicke bitte "
"hier:\n"
"Um die Änderung zu bestätigen, klicke bitte hier:\n"
"\n"
"{url}\n"
"\n"
"Dieser Link ist gültig für einen Tag.\n"
"\n"
"Wenn du dich nicht selbst angemeldet hast, kannst du diese E-Mail "
"ignorieren.\n"
"Wenn du dies nicht angefordert hast, kannst du diese E-Mail ignorieren.\n"
"\n"
"Viele Grüße\n"
"\n"
+114 -52
View File
@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-10-28 10:48+0000\n"
"PO-Revision-Date: 2025-10-04 10:10+0000\n"
"Last-Translator: Sebastian Bożek <sebastian@log-mar.pl>\n"
"PO-Revision-Date: 2026-11-15 23:00+0000\n"
"Last-Translator: Ikuisuus <kkujala@paivola.fi>\n"
"Language-Team: Finnish <https://translate.pretix.eu/projects/pretix/pretix/"
"fi/>\n"
"Language: fi\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.13.3\n"
"X-Generator: Weblate 2026.11.2\n"
#: pretix/_base_settings.py
msgid "English"
@@ -57,7 +57,7 @@ msgstr "tšekki"
#: pretix/_base_settings.py
msgid "Croatian"
msgstr "Kroatia"
msgstr "kroatia"
#: pretix/_base_settings.py
msgid "Danish"
@@ -89,11 +89,11 @@ msgstr "kreikka"
#: pretix/_base_settings.py
msgid "Hebrew"
msgstr ""
msgstr "Heprea"
#: pretix/_base_settings.py
msgid "Hungarian"
msgstr ""
msgstr "Unkari"
#: pretix/_base_settings.py
msgid "Indonesian"
@@ -149,11 +149,11 @@ msgstr "espanja"
#: pretix/_base_settings.py
msgid "Spanish (Latin America)"
msgstr ""
msgstr "Espanja (Etelä-Afrikka)"
#: pretix/_base_settings.py
msgid "Thai"
msgstr ""
msgstr "Thai"
#: pretix/_base_settings.py
msgid "Turkish"
@@ -297,22 +297,16 @@ msgid "The bundled item must not have bundles on its own."
msgstr "Niputettavalla tuotteella ei saa olla nippuja."
#: pretix/api/serializers/item.py
#, fuzzy
#| msgid "The payment is too late to be accepted."
msgid "The program start must not be empty."
msgstr "Maksu on liian myöhässä hyväksyttäväksi."
msgstr "Ohjelman alku ei voi olla tyhjä."
#: pretix/api/serializers/item.py
#, fuzzy
#| msgid "The payment is too late to be accepted."
msgid "The program end must not be empty."
msgstr "Maksu on liian myöhässä hyväksyttäväksi."
msgstr "Ohjelman loppu ei saa olla tyhjä."
#: pretix/api/serializers/item.py pretix/base/models/items.py
#, fuzzy
#| msgid "The maximum count needs to be greater than the minimum count."
msgid "The program end must not be before the program start."
msgstr "Enimmäismäärän on oltava suurempi kuin vähimmäismäärä."
msgstr "Ohjelma ei voi päättyä ennen kuin se alkaa."
#: pretix/api/serializers/item.py pretix/base/models/items.py
#, fuzzy
@@ -620,6 +614,8 @@ msgid ""
"This includes related events like creation, deletion, opening or closing of "
"quotas. No webhook is sent for changes to the resulting availability."
msgstr ""
"Tämä sisältää toiminnot kuten luonti, poisto, kiintiöiden avaamiset tai "
"sulkemiset. Aiheutuneista muutoksista ei lähetetä Webhook pyyntöä."
#: pretix/api/webhooks.py
msgid "Shop taken live"
@@ -670,6 +666,8 @@ msgid ""
"Only includes explicit changes to the voucher, not e.g. an increase of the "
"number of redemptions."
msgstr ""
"Sisältää vain varsinaiset muutokset kuponkiin, ei esimerkiksi lisäyksiä "
"lunastuskertoihin."
#: pretix/api/webhooks.py
#, fuzzy
@@ -850,6 +848,7 @@ msgid ""
"Field \"{field_name}\" does not exist. Please check your {provider_name} "
"settings."
msgstr ""
"Kenttä {field_name} ei ole olemassa. Tarkista {provider_name} asetukset."
#: pretix/base/datasync/datasync.py
#, python-brace-format
@@ -857,6 +856,8 @@ msgid ""
"Field \"{field_name}\" requires {required_input}, but only got "
"{available_inputs}. Please check your {provider_name} settings."
msgstr ""
"Kenttä {field_name} vaatii {required_input}, mutta sai vain "
"{available_inputs}. Tarkista {provider_name} asetukset."
#: pretix/base/datasync/datasync.py
#, python-brace-format
@@ -864,6 +865,8 @@ msgid ""
"Please update value mapping for field \"{field_name}\" - option \"{val}\" "
"not assigned"
msgstr ""
"Päivitä arvot kenttään {field_name} - vaihtoehdon {val} arvoa ei ole "
"määritetty"
#: pretix/base/datasync/sourcefields.py
#, fuzzy
@@ -894,7 +897,7 @@ msgstr "Tuotetiedot"
#: pretix/control/templates/pretixcontrol/order/index.html
#: pretix/presale/templates/pretixpresale/event/order.html
msgid "Order details"
msgstr ""
msgstr "Tilauksen yksityiskohdat"
#: pretix/base/datasync/sourcefields.py pretix/base/modelimport_orders.py
#: pretix/control/forms/filter.py
@@ -1304,7 +1307,7 @@ msgstr "Asiakkaat"
#: pretix/presale/templates/pretixpresale/organizers/customer_memberships.html
#: pretix/presale/views/customer.py
msgid "Memberships"
msgstr ""
msgstr "Jäsenyydet"
#: pretix/base/exporters/customers.py pretix/base/models/customers.py
#: pretix/control/templates/pretixcontrol/organizers/customer.html
@@ -2225,6 +2228,10 @@ msgid ""
"contain at least one position of this product. The order totals etc. still "
"include all products contained in the order."
msgstr ""
"Mikäli mitään ei valita, kaikki tuotteet sisällytetään. Tilaukset "
"sisältyvät, mikäli niissä on edes yksi valittu tuote. Tilauksen kokonaisarvo "
"ja muut vastaavat. yhä sisältävät kaikki tuotteet, jotka sisältyivät tähän "
"tilaukseen."
#: pretix/base/exporters/orderlist.py pretix/base/exporters/waitinglist.py
#: pretix/control/forms/event.py pretix/control/forms/organizer.py
@@ -3096,7 +3103,7 @@ msgstr "Sähköpostiosoite"
#: pretix/base/forms/auth.py pretix/control/forms/orders.py
#: pretix/control/templates/pretixcontrol/shredder/download.html
msgid "Confirmation code"
msgstr ""
msgstr "Varmistuskoodi"
#: pretix/base/forms/questions.py
#, fuzzy
@@ -3116,11 +3123,12 @@ msgid ""
"The field \"%(label)s\" may not contain special characters such as "
"\"%(chars)s\"."
msgstr ""
"Kenttä \"%(label)s\" ei saisi sisältää erikoismerkkejä kuten \"%(chars)s\"."
#: pretix/base/forms/questions.py
#, python-format
msgid "The field \"%(label)s\" may not contain an URL (%(url)s)."
msgstr ""
msgstr "Kenttä \"%(label)s\" ei saisi sisältää URL-osoitetta %(url)s."
#: pretix/base/forms/questions.py
msgctxt "phonenumber"
@@ -3186,7 +3194,7 @@ msgstr "Syötä lyhyempi nimi."
#: pretix/base/forms/questions.py
#, python-brace-format
msgid "Please enter a date and time between {min} and {max}."
msgstr ""
msgstr "Syötä päivämäärä ja aika väliltä {min} ja {max}."
#: pretix/base/forms/questions.py
#, fuzzy, python-brace-format
@@ -3409,7 +3417,7 @@ msgstr "Sähköpostiosoite vahvistettu"
#: pretix/base/invoicing/email.py
msgid "PDF via email"
msgstr ""
msgstr "PDF sähköpostilla"
#: pretix/base/invoicing/national.py
msgctxt "italian_invoice"
@@ -3851,7 +3859,7 @@ msgstr "Löytyi useita vastaavia päivämääriä."
#: pretix/base/modelimport_orders.py
msgid "Grouping"
msgstr ""
msgstr "Ryhmittely"
#: pretix/base/modelimport_orders.py
msgid ""
@@ -3870,6 +3878,9 @@ msgid ""
"The date can be specified through its full name, full date and time, or "
"internal ID, provided only one date in the system matches the input."
msgstr ""
"Päivään voi viitata sen koko nimellä, täydellä päivämääräällä ja ajalla tai "
"sisäisellä ID:llä, kunhan vain yksi päivämäärä järjestelmässä vastaa "
"syötteeseen."
#: pretix/base/modelimport_orders.py pretix/presale/views/waiting.py
msgctxt "subevent"
@@ -3880,6 +3891,8 @@ msgstr "Sinun täytyy valita päivämäärä."
msgid ""
"The product can be specified by its internal ID, full name or internal name."
msgstr ""
"Tuotteen voi tunnistaa sen sisäisellä ID:llä, koko nimellä tai sisäisellä "
"nimellä."
#: pretix/base/modelimport_orders.py pretix/base/modelimport_vouchers.py
msgid "No matching product was found."
@@ -3897,7 +3910,7 @@ msgstr "Tuotevariaatio"
#: pretix/base/modelimport_orders.py
msgid "The variation can be specified by its internal ID or full name."
msgstr ""
msgstr "Variaatioon voi viitata sen sisäisellä ID:llä tai koko nimellä."
#: pretix/base/modelimport_orders.py pretix/base/modelimport_vouchers.py
msgid "No matching variation was found."
@@ -3923,7 +3936,7 @@ msgstr "Syötä kelvollinen maatunnus."
#: pretix/base/modelimport_orders.py
msgid "The state can be specified by its short form or full name."
msgstr ""
msgstr "Tilaan voi viitata sen lyhyellä muodolla tai koko nimellä."
#: pretix/base/modelimport_orders.py
msgid "States are not supported for this country."
@@ -3969,7 +3982,7 @@ msgstr "Syötä kelvollinen kielikoodi."
msgid ""
"The sales channel can be specified by it's internal identifier or its full "
"name."
msgstr ""
msgstr "Myyntikanavaan voi viitata sen sisäisellä ID:llä tai koko nimellä."
#: pretix/base/modelimport_orders.py
msgid "Please enter a valid sales channel."
@@ -3977,7 +3990,7 @@ msgstr "Syötä kelvollinen myyntikanava."
#: pretix/base/modelimport_orders.py
msgid "The seat needs to be specified by its internal ID."
msgstr ""
msgstr "Paikkaan täytyy viitata sen sisäisellä ID:llä."
#: pretix/base/modelimport_orders.py pretix/base/modelimport_vouchers.py
msgid "Multiple matching seats were found."
@@ -4481,6 +4494,7 @@ msgstr "Erota useat arvot välilyönneillä"
#: pretix/base/models/datasync.py
msgid "Temporary error, auto-retry limit exceeded"
msgstr ""
"Väliaikainen virhe, automattisten uudelleen yritysten limiitti on ylitetty"
#: pretix/base/models/datasync.py
#, fuzzy
@@ -4494,7 +4508,7 @@ msgstr ""
#: pretix/base/models/datasync.py
msgid "System error, needs manual intervention"
msgstr ""
msgstr "Systeemivirhe, vattii manuaalista korjaamista"
#: pretix/base/models/devices.py pretix/base/models/items.py
msgid "Internal identifier"
@@ -4759,13 +4773,15 @@ msgstr "Valinnainen. Tuotteita ei myydä ennen tätä."
#: pretix/base/models/event.py
msgid "This event is remote or partially remote."
msgstr ""
msgstr "Tämä tapahtuma järjestetään joko osittain tai kokonaan etänä."
#: pretix/base/models/event.py
msgid ""
"This will be used to let users know if the event is in a different timezone, "
"and to let us calculate the local time of a user."
msgstr ""
"Tätä käytetään kertoakseen käyttäjille jos tapahtuma on eri aikavyöhykkeellä "
"ja mahdollistetaan käyttäjän paikallisen ajankohdan laskeminen."
#: pretix/base/models/event.py pretix/base/models/organizer.py
#: pretix/control/navigation.py
@@ -5061,7 +5077,7 @@ msgstr "Puuttuva summa"
#: pretix/base/models/invoices.py
msgid "currently being transmitted"
msgstr ""
msgstr "Siirretään parasta aikaa"
#: pretix/base/models/invoices.py
#, fuzzy
@@ -5084,7 +5100,7 @@ msgstr "tuntematon"
#: pretix/base/models/invoices.py
msgid "not transmitted due to test mode"
msgstr ""
msgstr "ei välitetty testimoodin vuoksi"
#: pretix/base/models/invoices.py
#, python-format
@@ -8340,6 +8356,8 @@ msgid ""
"Includes the ability to give someone (including oneself) additional "
"permissions."
msgstr ""
"Sisältää mahdollisuuden antaa jollekulle (itsesi mukaanlukien) lisää "
"oikeuksia."
#: pretix/base/permissions.py pretix/control/navigation.py
msgid "Devices"
@@ -8350,6 +8368,8 @@ msgid ""
"Includes the ability to give access to events and data oneself does not have "
"access to."
msgstr ""
"Sisältää mahdollisuuden antaa oikeuksia tapahtumiin ja dataan henkilöllä ei "
"ole vielä oikeuksia."
#: pretix/base/permissions.py
#, fuzzy
@@ -8360,7 +8380,7 @@ msgstr "Istumajärjestys"
#: pretix/base/permissions.py pretix/control/navigation.py
#: pretix/control/templates/pretixcontrol/organizers/outgoing_mails.html
msgid "Outgoing emails"
msgstr ""
msgstr "Lähtevät viestit"
#: pretix/base/plugins.py
#: pretix/control/templates/pretixcontrol/event/quick_setup.html
@@ -8369,19 +8389,19 @@ msgstr "Ominaisuudet"
#: pretix/base/plugins.py
msgid "Integrations"
msgstr ""
msgstr "Integraatiot"
#: pretix/base/plugins.py
msgid "Customizations"
msgstr ""
msgstr "Kustomoinnit"
#: pretix/base/plugins.py
msgid "Output and export formats"
msgstr ""
msgstr "Ulostulon ja vientien formaatit"
#: pretix/base/plugins.py
msgid "API features"
msgstr ""
msgstr "API ominaisuudet"
#: pretix/base/reldate.py
msgid "Event start"
@@ -8443,6 +8463,7 @@ msgstr "Ei asetettu"
#, python-brace-format
msgid "A relative date cannot be expressed as \"before\" for \"{}\""
msgstr ""
"Suhteellista päivämäärää ei voida ilmaista muodossa \"Ennen\" \"{}\" varten"
#: pretix/base/reldate.py
#, python-brace-format
@@ -8478,7 +8499,7 @@ msgstr "Tapahtuma peruttu"
#: pretix/base/services/cancelevent.py
msgid "Confirm event cancellation and bulk refund"
msgstr ""
msgstr "Vahvista tapahtuman peruminen ja rahojen palauttaminen massana"
#: pretix/base/services/cart.py pretix/base/services/modelimport.py
#: pretix/base/services/orders.py
@@ -8512,6 +8533,8 @@ msgid ""
"Some products can no longer be purchased and have been removed from your "
"cart for the following reason: %s"
msgstr ""
"Joitain tuotteista ei voida enää ostaa ja ne on poistettu ostoskoristasi "
"seuraavasta syystä: %s"
#: pretix/base/services/cart.py
msgid ""
@@ -9392,7 +9415,7 @@ msgstr "Kuponkia ei voi luoda ilman koodia."
#, python-brace-format
msgid ""
"Voucher codes must be unique. Code \"{code}\" already exists in this import."
msgstr ""
msgstr "Kuponkikoodien täytyy olla uniikkeja. Koodi \"{code}\" on jo olemassa."
#: pretix/base/services/modelimport.py
#, python-brace-format
@@ -9401,13 +9424,19 @@ msgid ""
msgid_plural ""
"Voucher codes must be unique. Import contains existing voucher codes {code}."
msgstr[0] ""
"Kuponkikoodien tulee olla uniikkeja. Tuoduissa tiedoissa on mukana olemassa "
"oleva kuponkikoodi {code}."
msgstr[1] ""
"Kuponkikoodien tulee olla uniikkeja. Tuoduissa tiedoissa on mukana olemassa "
"olevia kuponkikoodeja {code}."
#: pretix/base/services/modelimport.py
msgid ""
"Vouchers could not be imported, probably due to a voucher code already being "
"in use."
msgstr ""
"Kuponkeja ei voitu tuoda, todennäköisesti koska kupongin koodi on jo "
"käytössä."
#: pretix/base/services/orders.py
msgid ""
@@ -9886,17 +9915,19 @@ msgstr "Kuponki on lähetetty {recipient}."
#: pretix/base/settings.py
msgid "Compute taxes for every line individually"
msgstr ""
msgstr "Laske verot jokaiselle riville yksittäin"
#: pretix/base/settings.py
msgid "Compute taxes based on net total"
msgstr ""
msgstr "Laske verot kokonaissumman perusteella"
#: pretix/base/settings.py
msgid ""
"For business customers, compute taxes based on net total. For individuals, "
"use line-based rounding"
msgstr ""
"Lasket verot nettosumman pohjalta yritysasiakkaille. Käytä rivipohjaista "
"pyöristystä yksityishenkilöille"
#: pretix/base/settings.py
msgid "Compute taxes based on net total with stable gross prices"
@@ -9932,7 +9963,7 @@ msgstr ""
#: pretix/base/settings.py
msgid "Require login to access order confirmation pages"
msgstr ""
msgstr "Vaadi kirjautumista tilausvahvistus sivuille pääsyyn"
#: pretix/base/settings.py
msgid ""
@@ -9941,6 +9972,10 @@ msgid ""
"placing an order, the restriction only becomes active after the customer "
"account is activated."
msgstr ""
"Jos tämä on päällä, käyttäjien, jotka olivat kirjautuneena ostoksen aikana, "
"täytyy kirjautua sisään myös päästäkseen käsiksi tilausvahvistukseensa. Jos "
"käyttäjätili on luotu tilauksen yhteydessä, rajoite astuu voimaan vasta kun "
"käyttäjätili on aktivoitu."
#: pretix/base/settings.py
msgid "Match orders based on email address"
@@ -10142,7 +10177,7 @@ msgstr "Vaaditaan puhelinnumero tilausta kohden"
#: pretix/base/settings.py
msgid "Rounding of taxes"
msgstr ""
msgstr "Verojen pyöristys"
#: pretix/base/settings.py
msgid ""
@@ -10150,6 +10185,10 @@ msgid ""
"for tax reporting, you need to make sure to account for possible rounding "
"differences if your external system rounds differently than pretix."
msgstr ""
"Huomaa, että jos siirrät myyntidataa Pretixistä ulkoiseen järjestelmään "
"verojen ilmoittamista varten, on hyvä varmistaa mahdollisten pyöristys "
"erojen käsittely mikäli ulkoinen järjestelmäsi pyöristää eri tavalla kuin "
"Pretix."
#: pretix/base/settings.py
msgid "Ask for invoice address"
@@ -10293,6 +10332,9 @@ msgid ""
"ID in all countries. VAT ID will be required for all business addresses in "
"the selected countries."
msgstr ""
"Veronumero on vapaaehtoinen oletusarvoisesti, koska kaikkilla yrityksillä ei "
"ole veronumeroa kaikissa maissa. Veronumero vaaditaan kaikilta yritys "
"osoitteilta valituissa maissa."
#: pretix/base/settings.py
msgid "Invoice address explanation"
@@ -10448,12 +10490,12 @@ msgstr ""
#: pretix/base/settings.py
msgid "No dates match your criteria."
msgstr ""
msgstr "Yksikään päivämäärä ei vastaa kriteereitäsi."
#: pretix/base/settings.py
msgctxt "subevents"
msgid "Text for empty date results"
msgstr ""
msgstr "Teksti tyhjille päivämäärätuloksille"
#: pretix/base/settings.py
msgctxt "subevents"
@@ -10464,6 +10506,11 @@ msgid ""
"touch with you to arrange further dates. We do not recommend more than one "
"or two sentences."
msgstr ""
"Tämä teksti näytetään jos kalenteri tai päivämäärälista on tyhjä. "
"Esimerkiksi jos kuukausi ei vastaa päivämäärää tai käyttäjän valitsema "
"filtteriin vastaamia tuloksia ei löydy. Voit käyttää tätä mainostamaan "
"tapoja ottaa yhteyttä teihin tulevien päivämäärien sopimiseksi. Emme "
"suosittele enempää kuin yhtä tai kahta lausetta."
#: pretix/base/settings.py
msgid "Guidance text"
@@ -10648,6 +10695,9 @@ msgid ""
"their order without selecting a payment method. This is useful whenever "
"orders are not created by the same person who is making the payment."
msgstr ""
"Jos maksun viivästäminen on sallittu myyntikanavassa, asiakkaat voivat "
"asettaa tilauksen valitsematta maksutapaa. Tämä on kätevää kun tilaukset "
"eivät ole saman henkilön tekemiä, joka maksaa tilauksen."
#: pretix/base/settings.py
msgid "Show start date"
@@ -10731,10 +10781,13 @@ msgid ""
"Automatic based on ticket-specific validity, membership validity, event "
"series date, or event date"
msgstr ""
"Automaattinen perustuen lippukohtaiseen voimassaoloon, jäsenyyden voimassa "
"oloon, tapahtumasarjan päivämäärään tai tapahtuman päivämäärään"
#: pretix/base/settings.py
msgid "Automatic, but prefer invoice date over event date"
msgstr ""
"Automaattinen, mutta suosi laskun päivämäärää tapahtuman päivämäärän sijaan"
#: pretix/base/settings.py
#, fuzzy
@@ -10755,6 +10808,8 @@ msgid ""
"This controls what dates are shown on the invoice, but is especially "
"important for electronic invoicing."
msgstr ""
"Tämä kontrolloi mitkä päivämäärät näytetään laskulla ja on erityisen tärkeä "
"sähköisessä laskutuksessa."
#: pretix/base/settings.py
msgid "Automatically cancel and reissue invoice on address changes"
@@ -10933,6 +10988,12 @@ msgid ""
"page. Note that pretix still is a system built around events and the date "
"may still show up in other places."
msgstr ""
"Jätä tämä laatikko valitsematta vain jos myyt jotain millä ei ole erillistä "
"päivää, kuten lahjakortti tai lippu, jonka voi käyttää koska tahansa. "
"Järjestelmä lakkaa näyttämästä tapahtuma päivää joissain paikoissa kuten "
"tapahtuman aloitussivulla. Huomaathan että Pretix on silti järjestelmä, joka "
"on rakennettu tapahtumien ympärille ja päivämäärä saatetaan silti näyttää "
"muissa paikoissa."
#: pretix/base/settings.py
msgid "Show event end date"
@@ -13228,7 +13289,7 @@ msgstr "Sinun on vaadittava laskuosoitteet yritysten nimille."
#: pretix/base/settings.py
#, python-brace-format
msgid "VAT-ID is not supported for \"{}\"."
msgstr ""
msgstr "Veronumeroa ei tueta \"{}\" varten."
#: pretix/base/settings.py
msgid "The last payment date cannot be before the end of presale."
@@ -13487,7 +13548,7 @@ msgstr ""
#: pretix/base/templates/pretixbase/email/cancel_confirm.txt
msgid "You requested to cancel an event that involves a large bulk refund:"
msgstr ""
msgstr "Pyyntösi perua tapahtuma, joka sisältää suuren massapalautuksen:"
#: pretix/base/templates/pretixbase/email/cancel_confirm.txt
#, fuzzy
@@ -13497,7 +13558,7 @@ msgstr "Hyvitettävä summa"
#: pretix/base/templates/pretixbase/email/cancel_confirm.txt
msgid "To confirm, paste the following code into the cancellation form:"
msgstr ""
msgstr "Vahvistaaksesi kopioi seuraava koodi peruutus lomakkeelle:"
#: pretix/base/templates/pretixbase/email/cancel_confirm.txt
#, python-format
@@ -13505,6 +13566,7 @@ msgid ""
"Don't share this code with anyone. The %(instance)s team will never ask you "
"for it."
msgstr ""
"Älä jaa tätä koodia kenellekää. %(instance)s tiimi ei koskaan kysy sitä."
#: pretix/base/templates/pretixbase/email/cancel_confirm.txt
#: pretix/base/templates/pretixbase/email/export_failed.txt
@@ -13513,6 +13575,8 @@ msgid ""
"Thanks, \n"
"The %(instance)s Team"
msgstr ""
"Kiitos, \n"
"%(instance)s tiimi"
#: pretix/base/templates/pretixbase/email/email_footer.html
#, python-format
@@ -13558,10 +13622,8 @@ msgstr "Vaihda asetuksia"
#: pretix/base/templates/pretixbase/email/notification.html
#: pretix/base/templates/pretixbase/email/notification.txt
#, fuzzy
#| msgid "Click here disable all notifications immediately."
msgid "Disable all notifications"
msgstr "Klikkaa tästä poista kaikki ilmoitukset käytöstä välittömästi."
msgstr "Poista kaikki ilmoitukset käytöstä"
#: pretix/base/templates/pretixbase/email/order_details.html
msgid ""
@@ -13611,7 +13673,7 @@ msgstr "Saat tämän sähköpostiviestin, koska olet tehnyt {event}tilauksen."
#: pretix/presale/templates/pretixpresale/organizers/customer_memberships.html
#: pretix/presale/templates/pretixpresale/organizers/customer_orders.html
msgid "Details"
msgstr ""
msgstr "Yksityiskohdat"
#: pretix/base/templates/pretixbase/email/order_details.html
#: pretix/presale/templates/pretixpresale/event/base.html
+8
View File
@@ -196,6 +196,14 @@ OPTIONS = OrderedDict([
'offsets': [46 * mm, 46 * mm],
'pagesize': pagesizes.A4,
}),
('herma_75x40', {
'name': 'HERMA 75 x 40 mm (9010)',
'cols': 2,
'rows': 6,
'margins': [28.5 * mm, 25 * mm, 28.5 * mm, 25 * mm],
'offsets': [85 * mm, 40 * mm],
'pagesize': pagesizes.A4,
}),
('herma_88.9x33.87', {
'name': 'HERMA 88,9 x 33,87 mm (4515)',
'cols': 2,
+5
View File
@@ -219,6 +219,11 @@ TEMPLATES = {
"pagesize": (75 * mm, 52 * mm),
"layout": _simple_template(75 * mm, 52 * mm),
},
"75x40": {
"label": format_lazy(_("{width} x {height} mm label"), width=75, height=40),
"pagesize": (75 * mm, 40 * mm),
"layout": _simple_template(75 * mm, 40 * mm),
},
"70x36": {
"label": format_lazy(_("{width} x {height} mm label"), width=70, height=36),
"pagesize": (70 * mm, 36 * mm),
+28 -17
View File
@@ -27,6 +27,7 @@ from decimal import Decimal
from django import forms
from django.db.models import F, Sum
from django.db.models.aggregates import Min
from django.db.models.functions import Coalesce
from django.utils.formats import date_format
from django.utils.html import escape
@@ -41,7 +42,8 @@ from reportlab.platypus import (
from pretix.base.exporter import BaseExporter
from pretix.base.models import (
GiftCardTransaction, OrderFee, OrderPayment, OrderRefund, Transaction,
GiftCardTransaction, Order, OrderFee, OrderPayment, OrderRefund,
Transaction,
)
from pretix.base.templatetags.money import money_filter, tax_rate_format
from pretix.base.timeframes import (
@@ -116,25 +118,34 @@ class ReportExporter(ReportlabExportMixin, BaseExporter):
dt_start, df_end = resolve_timeframe_to_datetime_start_inclusive_end_exclusive(
now(), form_data["date_range"], self.timezone
)
if dt_start:
filters.append(
_("Begin")
+ ": "
+ date_format(
else:
dt_start = Order.objects.filter(
event__in=self.events,
).aggregate(min_datetime=Min('datetime'))['min_datetime']
df_end = now()
if dt_start:
filters.append(
"{label}: {value}{hint}".format(
label=_("Begin"),
value=date_format(
dt_start.astimezone(self.timezone), "SHORT_DATETIME_FORMAT"
)
),
hint="" if form_data["date_range"] else " ({})".format(_("first order received"))
)
if df_end:
filters.append(
_("End")
+ ": "
+ date_format(
(df_end - datetime.timedelta.resolution).astimezone(
self.timezone
),
"SHORT_DATETIME_FORMAT",
)
)
if df_end:
filters.append(
_("End")
+ ": "
+ date_format(
(df_end - datetime.timedelta.resolution).astimezone(
self.timezone
),
"SHORT_DATETIME_FORMAT",
)
)
if not form_data["no_testmode"]:
filters.append(_("Report includes test orders which may be deleted later!"))
+2 -1
View File
@@ -98,7 +98,7 @@ class TicketLayoutSerializer(I18nAwareModelSerializer):
return d
def validate(self, attrs):
if attrs.get('default') and self.context['event'].ticket_layouts.filter(default=True).exists:
if attrs.get('default') and self.context['event'].ticket_layouts.filter(default=True).exists():
raise ValidationError('You cannot have two layouts with default = True')
return attrs
@@ -123,6 +123,7 @@ class TicketLayoutViewSet(viewsets.ModelViewSet):
serializer_class = TicketLayoutSerializer
queryset = TicketLayout.objects.none()
lookup_field = 'id'
write_permission = 'event.settings.general:write'
def get_queryset(self):
return self.request.event.ticket_layouts.all()
+1 -1
View File
@@ -267,7 +267,7 @@ class CustomerStep(CartMixin, TemplateFlowStep):
else None
),
prefix='login',
request=self.request.event,
request=self.request,
)
for field in f.fields.values():
field._show_required = field.required
+7
View File
@@ -75,6 +75,7 @@ class AuthenticationForm(forms.Form):
'unverified': _("You have not yet activated your account and set a password. Please click the link in the "
"email we sent you. In case you cannot find it, click \"Forgot your password?\" to receive "
"a new email."),
'rate_limit': _("For security reasons, please wait 5 minutes before you try again."),
}
def __init__(self, request=None, *args, **kwargs):
@@ -93,6 +94,12 @@ class AuthenticationForm(forms.Form):
email = self.cleaned_data.get('email')
password = self.cleaned_data.get('password')
if rate_limit("customer_login", include_ip_from_request=self.request, max_num=10, expire_time=300):
raise forms.ValidationError(
self.error_messages['rate_limit'],
code='rate_limit',
)
if email is not None and password:
try:
u = self.request.organizer.customers.get(email=email.lower(), provider__isnull=True)
@@ -55,7 +55,7 @@
<div class="col-md-6 col-md-offset-3">
{% for provider in request.organizer.sso_providers.all %}
{% if provider.is_active %}
<a href="{% eventurl request.organizer "presale:organizer.customer.login" provider=provider.pk %}?next={% if request.domain_mode == 'event' or request.domain_mode == 'organizer_alternative' %}{{ request.scheme }}://{{ request.get_host }}{% endif %}{{ request.get_full_path|urlencode }}"
<a href="{% abseventurl request.organizer "presale:organizer.customer.login" provider=provider.pk %}?next={% if request.domain_mode == 'event' or request.domain_mode == 'organizer_alternative' %}{{ request.scheme }}://{{ request.get_host }}{% endif %}{{ request.get_full_path|urlencode }}"
class="btn btn-primary btn-lg btn-block" data-open-in-popup-window>
{{ provider.button_label }}
</a>
@@ -44,7 +44,6 @@
{% else %}
<meta property="og:url" content="{% abseventurl request.event "presale:event.index" %}" />
{% endif %}
<script type="text/javascript" src="{% static "pretixpresale/js/csrfcookieretry.js" %}"></script>
{% endblock %}
{% block content %}
@@ -23,10 +23,6 @@
{% endif %}
{% trans "Order details" %}
{% endblock %}
{% block custom_header %}
{{ block.super }}
<script type="text/javascript" src="{% static "pretixpresale/js/csrfcookieretry.js" %}"></script>
{% endblock %}
{% block content %}
{% if "thanks" in request.GET or "paid" in request.GET %}
<div class="thank-you">
@@ -23,4 +23,5 @@
<script type="text/javascript" src="{% static "pretixbase/js/addressform.js" %}"></script>
<script type="text/javascript" src="{% static "pretixbase/js/deanonymize_email.js" %}"></script>
<script type="text/javascript" src="{% static "pretixbase/js/errors.js" %}"></script>
<script type="text/javascript" src="{% static "pretixbase/js/csrfcookieretry.js" %}"></script>
{% endcompress %}
+7 -4
View File
@@ -26,7 +26,8 @@ from binascii import unhexlify
from datetime import timedelta
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
from Crypto.PublicKey import RSA
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicKey
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from django.db import transaction
from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import redirect, render
@@ -498,7 +499,9 @@ class KeysView(View):
def get(self, request, *args, **kwargs):
privkey, pubkey = _get_or_create_server_keypair(request.organizer)
kid = hashlib.sha256(pubkey.encode()).hexdigest()[:16]
pubkey = RSA.import_key(pubkey)
public_key = load_pem_public_key(pubkey.encode())
assert isinstance(public_key, RSAPublicKey)
public_numbers = public_key.public_numbers()
return JsonResponse({
'keys': [
@@ -507,8 +510,8 @@ class KeysView(View):
'alg': 'RS256',
'kid': kid,
'use': 'sig',
'e': self._encode_int(pubkey.e).decode().rstrip("="),
'n': self._encode_int(pubkey.n).decode().rstrip("="),
'e': self._encode_int(public_numbers.e).decode().rstrip("="),
'n': self._encode_int(public_numbers.n).decode().rstrip("="),
}
]
})
+4 -1
View File
@@ -76,7 +76,7 @@ from pretix.base.models.tax import TaxedPrice
from pretix.base.payment import PaymentException
from pretix.base.services.invoices import (
generate_cancellation, generate_invoice, invoice_pdf, invoice_pdf_task,
invoice_qualified,
invoice_qualified, transmit_invoice,
)
from pretix.base.services.orders import (
OrderChangeManager, OrderError, _try_auto_refund, cancel_order,
@@ -907,6 +907,9 @@ class OrderModify(EventViewMixin, OrderDetailMixin, OrderQuestionsViewMixin, Tem
self.order.log_action('pretix.event.order.invoice.reissued', data={
'invoice': inv.pk
})
transmit_invoice.apply_async(args=(c.event_id, c.pk, True))
if c.pk != inv.pk:
transmit_invoice.apply_async(args=(inv.event_id, inv.pk, True))
messages.success(self.request, _('The invoice has been reissued.'))
except Exception as e:
self.order.log_action("pretix.event.order.invoice.failed", data={
+6 -1
View File
@@ -35,6 +35,7 @@ import calendar
import hashlib
import math
import operator
import re
from collections import defaultdict
from datetime import date, datetime, time, timedelta
from functools import reduce
@@ -381,7 +382,11 @@ class EventListMixin:
def _set_week_year(self):
if 'date' in self.request.GET:
try:
iso = dateutil.parser.isoparse(self.request.GET.get('date')).isocalendar()
input = self.request.GET.get('date')
# Our parameters for the single-digit weeks of the year are 2027-W2, as emitted by Django's "W" format code,
# but dateutil 4.0 is strict about ISO and only accepts 2027-W02 as valid.
input = re.sub('-W([0-9])$', '-W0\\1', input)
iso = dateutil.parser.isoparse(input).isocalendar()
except ValueError:
iso = time_machine_now().isocalendar()
self.year = iso[0]
@@ -0,0 +1,76 @@
document.addEventListener('DOMContentLoaded', () => {
const COOKIE_NAME = window.location.protocol === 'https:' ? '__Host-pretix_csrftoken' : 'pretix_csrftoken'
const RELOAD_FLAG = 'csrfReloadPerformed'
const REASON_PARAM = 'csrf_reload'
const CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
// reimplementation of CSRFMiddlewares _unmask_cipher_token()
const unmask = (token) => {
if (!token || token.length !== 64) return token || null
let secret = ''
for (let i = 0; i < 32; i++) {
const m = CHARS.indexOf(token[i])
const c = CHARS.indexOf(token[32 + i])
if (m < 0 || c < 0) return null
secret += CHARS[(c - m + CHARS.length) % CHARS.length]
}
return secret
}
const url = new URL(location.href)
// remove reason after reload to avoid re-reports
if (url.searchParams.has(REASON_PARAM)) {
url.searchParams.delete(REASON_PARAM)
history.replaceState(history.state, '', url)
}
const readCookieSecrets = () => document.cookie
.split('; ')
.filter((c) => c.startsWith(COOKIE_NAME + '='))
.map((c) => unmask(c.slice(COOKIE_NAME.length + 1)))
// a deletion only hits the variant whose attributes it matches
const EXPIRE = `${COOKIE_NAME}=; Path=/; Secure; Max-Age=0`
const deleteUnpartitioned = () => {
document.cookie = EXPIRE
}
const deletePartitioned = () => {
document.cookie = `${EXPIRE}; Partitioned`
}
const field = document.querySelector('input[name="csrfmiddlewaretoken"]')
const pageSecret = field ? unmask(field.value) : null
// bail if there is no pageSecret
if (!pageSecret) return
const check = (secrets) => {
if (secrets.length === 0) return 'no_cookie'
if (secrets.length > 1) return 'duplicate_cookie'
if (!secrets[0]) return 'invalid_cookie'
if (pageSecret !== null && pageSecret !== secrets[0]) return 'mismatch'
return null
}
let cookieSecrets = readCookieSecrets()
let reason = check(cookieSecrets)
if (reason === 'duplicate_cookie') {
// drop the unpartitioned cookie, keep the partitioned one, maybe this fixes all issues
deleteUnpartitioned()
cookieSecrets = readCookieSecrets()
if (check(cookieSecrets)) {
reason = 'duplicate_cookie'
} else {
reason = null
}
}
if (reason && !sessionStorage.getItem(RELOAD_FLAG)) {
sessionStorage.setItem(RELOAD_FLAG, '1')
deleteUnpartitioned()
deletePartitioned()
url.searchParams.set(REASON_PARAM, reason)
location.href = url.href
} else if (!reason && sessionStorage.getItem(RELOAD_FLAG)) {
sessionStorage.removeItem(RELOAD_FLAG)
}
})
@@ -1,15 +0,0 @@
document.addEventListener('DOMContentLoaded', () => {
const COOKIE_NAME = '__Host-pretix_csrftoken'
const RELOAD_FLAG = 'csrfReloadPerformed'
const hasCookie = document.cookie
.split('; ')
.some((c) => c.startsWith(COOKIE_NAME + '='))
if (!hasCookie && !sessionStorage.getItem(RELOAD_FLAG)) {
sessionStorage.setItem(RELOAD_FLAG, '1')
location.reload()
} else if (hasCookie && sessionStorage.getItem(RELOAD_FLAG)) {
sessionStorage.removeItem(RELOAD_FLAG)
}
})
+114
View File
@@ -469,6 +469,22 @@ def test_event_scheduled_export_update_token(token_client, organizer, event, use
assert created.export_form_data == {"_format": "xlsx", "date_range": "month_this", "items": []}
@pytest.mark.django_db
def test_event_scheduled_export_update_identifier_readonly(token_client, organizer, event, user, event_scheduled_export):
resp = token_client.patch(
'/api/v1/organizers/{}/events/{}/scheduled_exports/{}/'.format(
organizer.slug, event.slug, event_scheduled_export.pk,
),
data={
"export_identifier": "transactions",
"export_form_data": {"_format": "xlsx", "date_range": "month_this"},
},
format='json'
)
assert resp.status_code == 400
assert resp.data == {"export_identifier": ["export_identifier cannot be changed for existing exports."]}
@pytest.fixture
def org_scheduled_export(organizer, user):
e = organizer.scheduled_exports.create(
@@ -637,6 +653,23 @@ def test_org_scheduled_export_update_token(token_client, organizer, user, org_sc
assert created.timezone == "America/New_York"
@pytest.mark.django_db
def test_org_scheduled_export_update_identifier_readonly(token_client, organizer, user, org_scheduled_export):
resp = token_client.patch(
'/api/v1/organizers/{}/scheduled_exports/{}/'.format(
organizer.slug, org_scheduled_export.pk,
),
data={
"export_identifier": "transactions",
"export_form_data": {"_format": "xlsx", "date_range": "month_this"},
"timezone": "America/New_York"
},
format='json'
)
assert resp.status_code == 400
assert resp.data == {"export_identifier": ["export_identifier cannot be changed for existing exports."]}
@pytest.mark.django_db
def test_org_scheduled_export_validate_identifier(user_client, organizer, user):
resp = user_client.post(
@@ -1012,6 +1045,87 @@ def _get_and_patch_event_export(client, scheduled, can_see=True, can_edit=True):
return True
@pytest.mark.django_db(transaction=True)
def test_organizer_edit_restrictions_event_expansion(client, event, organizer, user, team):
# This tests the prevention of a possible privilege escalation where user A creates a scheduled export and
# user B has settings permission (= they can see the export configuration), and enough permission
# to run the export themselves, but not enough permission to add events. Without this check, user B could
# modify the export and add themselves as a recipient. Thereby, user B would gain access to data they can't have.
user1_client = APIClient()
user1_client.force_authenticate(user=user)
user2 = User.objects.create_user("dummy2@dummy.dummy", "dummy")
user2_client = APIClient()
user2_client.force_authenticate(user=user2)
event1 = event
event2 = Event.objects.create(
organizer=organizer, name="Dummy", slug="dummy2",
date_from=now(), plugins="pretix.plugins.banktransfer,pretix.plugins.stripe,tests.testdummy"
)
# Team 1 has access only to one event
team1 = team
team1.all_organizer_permissions = False
team1.all_event_permissions = False
team1.all_events = False
team1.limit_organizer_permissions = {"organizer.settings.general:write": True}
team1.limit_event_permissions = {"event.orders:read": True, "event.settings.general:write": True}
team1.save()
team1.limit_events.add(event1)
team1.members.add(user)
# Team 2 has full admin access
team2 = organizer.teams.create(
all_organizer_permissions=True, all_event_permissions=True, all_events=True,
)
team2.members.add(user2)
s1 = ScheduledOrganizerExport.objects.create(
organizer=organizer,
owner=user2,
export_identifier="dummy_orders",
export_form_data={"all_events": False, "events": [event1.pk]},
mail_subject="Test",
mail_template="Test",
locale="en",
schedule_rrule="DTSTART:20230118T000000\nRRULE:FREQ=DAILY;INTERVAL=1;WKST=MO",
schedule_rrule_time=time(2, 30, 0)
)
# User 1 can change …
response = user1_client.patch(
'/api/v1/organizers/{}/scheduled_exports/{}/'.format("dummy", s1.pk),
data={"mail_subject": "Hello"},
format='json',
)
assert response.status_code == 200
# … but not expand scope
response = user1_client.patch(
'/api/v1/organizers/{}/scheduled_exports/{}/'.format("dummy", s1.pk),
data={"export_form_data": {"all_events": False, "events": [event1.slug, event2.slug], "_format": "xlsx", "date_range": "year_this", "items": []}},
format='json',
)
assert response.status_code == 400
response = user1_client.patch(
'/api/v1/organizers/{}/scheduled_exports/{}/'.format("dummy", s1.pk),
data={"export_form_data": {"all_events": True, "events": [], "_format": "xlsx", "date_range": "year_this", "items": []}},
format='json',
)
assert response.status_code == 403
# User 2 can expand
response = user2_client.patch(
'/api/v1/organizers/{}/scheduled_exports/{}/'.format("dummy", s1.pk),
data={"export_form_data": {"all_events": True, "events": [], "_format": "xlsx", "date_range": "year_this", "items": []}},
format='json',
)
assert response.status_code == 200
response = user2_client.patch(
'/api/v1/organizers/{}/scheduled_exports/{}/'.format("dummy", s1.pk),
data={"export_form_data": {"all_events": False, "events": [event1.slug, event2.slug], "_format": "xlsx", "date_range": "year_this", "items": []}},
format='json',
)
assert response.status_code == 200
@pytest.mark.django_db(transaction=True)
def test_event_edit_restrictions(client, event, organizer, user, team):
# This tests the prevention of a possible privilege escalation where user A creates a scheduled export and
-1
View File
@@ -333,7 +333,6 @@ def test_order_update_transmission_validation(token_client, organizer, event, or
assert resp.status_code == 400
assert resp.data == {"invoice_address": {"transmission_info": {
"transmission_it_sdi_pec": ["Enter a valid email address.", "Enter a valid email address."],
"transmission_it_sdi_recipient_code": ["This field is required."]
}}}
resp = token_client.patch(
+12 -1
View File
@@ -696,7 +696,7 @@ def test_medium_autocreate_giftcard(token_client, organizer, team):
@pytest.mark.django_db
def test_medium_lookup_cross_organizer(token_client, organizer, organizer2, org2_event, medium2, giftcard2):
def test_medium_lookup_cross_organizer(token_client, organizer, customer, organizer2, org2_event, medium2, giftcard2):
with scopes_disabled():
o = Order.objects.create(
code='FOO', event=org2_event, email='dummy@dummy.test',
@@ -708,7 +708,12 @@ def test_medium_lookup_cross_organizer(token_client, organizer, organizer2, org2
personalized=True)
op = o.positions.create(item=ticket, price=Decimal("14"))
medium2.linked_orderpositions.add(op)
medium2.customer = customer
medium2.linked_giftcard = giftcard2
medium2.claim_token = "1234"
medium2.info = {"foo": "bar"}
medium2.notes = "Internal notes"
medium2.label = "Max Muster"
medium2.save()
resp = token_client.post(
@@ -755,3 +760,9 @@ def test_medium_lookup_cross_organizer(token_client, organizer, organizer2, org2
assert resp.data["result"]["organizer"] == "partner"
assert resp.data["result"]["linked_giftcard"] is not None
assert resp.data["result"]["linked_orderposition"] is None
assert resp.data["result"]["linked_orderpositions"] == []
assert resp.data["result"]["customer"] is None
assert resp.data["result"]["info"] == {}
assert resp.data["result"]["notes"] is None
assert resp.data["result"]["claim_token"] is None
assert resp.data["result"]["label"] is None
+93
View File
@@ -506,6 +506,99 @@ def test_organizer_edit_restrictions(client, env):
assert _can_see_but_not_edit_org_export(client, user1, s2)
def _patch_org_export(client, user, scheduled, data):
client.login(email=user.email, password="dummy")
response = client.get("/control/organizer/dummy/export/")
assert f"export/{scheduled.pk}/delete".encode() in response.content
response = client.get(f"/control/organizer/dummy/export/?identifier={scheduled.export_identifier}&scheduled={scheduled.pk}")
if response.status_code == 404:
return False
assert response.status_code == 200
doc = BeautifulSoup(response.content, "lxml")
form_data = extract_form_fields(doc.select("form[data-asynctask]")[0])
form_data["schedule"] = "save"
for k, v in data.items():
if v is None:
form_data.pop(k, None)
else:
form_data[k] = v
response = client.post(f"/control/organizer/dummy/export/?identifier={scheduled.export_identifier}&scheduled={scheduled.pk}",
data=form_data, follow=True)
assert response.status_code == 200
return b"alert-success" in response.content and b"therefore you cannot" not in response.content
@pytest.mark.django_db(transaction=True)
def test_organizer_edit_restrictions_event_expansion(client, env):
# This tests the prevention of a possible privilege escalation where user A creates a scheduled export and
# user B has settings permission (= they can see the export configuration), and enough permission
# to run the export themselves, but not enough permission to add events. Without this check, user B could
# modify the export and add themselves as a recipient. Thereby, user B would gain access to data they can't have.
user = env[1]
user2 = User.objects.create_user("dummy2@dummy.dummy", "dummy")
event1 = env[0]
event2 = Event.objects.create(
organizer=env[0].organizer, name="Dummy", slug="dummy2",
date_from=now(), plugins="pretix.plugins.banktransfer,pretix.plugins.stripe,tests.testdummy"
)
# Team 1 has access only to one event
team1 = env[2]
team1.all_organizer_permissions = False
team1.all_event_permissions = False
team1.all_events = False
team1.limit_organizer_permissions = {"organizer.settings.general:write": True}
team1.limit_event_permissions = {"event.orders:read": True, "event.settings.general:write": True}
team1.save()
team1.limit_events.add(event1)
team1.members.add(user)
# Team 2 has full admin access
team2 = env[0].organizer.teams.create(
all_organizer_permissions=True, all_event_permissions=True, all_events=True,
)
team2.members.add(user2)
s1 = ScheduledOrganizerExport.objects.create(
organizer=env[0].organizer,
owner=user2,
export_identifier="dummy_orders",
export_form_data={"all_events": False, "events": [event1.pk]},
mail_subject="Test",
mail_template="Test",
locale="en",
schedule_rrule="DTSTART:20230118T000000\nRRULE:FREQ=DAILY;INTERVAL=1;WKST=MO",
schedule_rrule_time=datetime.time(2, 30, 0)
)
# User 1 can change …
assert _patch_org_export(
client, user, s1,
{"schedule-mail_subject": "Hello"},
)
# … but not expand scope
assert not _patch_org_export(
client, user, s1,
{"dummy_orders-events": [event1.pk, event2.pk]},
)
assert not _patch_org_export(
client, user, s1,
{"dummy_orders-all_events": "on", "dummy_orders-events": None},
)
# User 2 can expand
assert _patch_org_export(
client, user2, s1,
{"dummy_orders-all_events": "on", "dummy_orders-events": None},
)
assert _patch_org_export(
client, user2, s1,
{"dummy_orders-events": [event1.pk, event2.pk]},
)
def _can_see_but_not_edit_event_export(client, user, scheduled):
client.login(email=user.email, password="dummy")
@@ -164,6 +164,21 @@ def test_api_create_validate_default(env, token_client):
assert resp.status_code == 400
assert resp.data == {"non_field_errors": ["You cannot have two layouts with default = True"]}
env[0].ticket_layouts.filter(default=True).update(default=False)
resp = token_client.post(
'/api/v1/organizers/{}/events/{}/ticketlayouts/'.format(env[0].slug, env[0].slug),
{
'name': 'Foo',
'default': True,
'layout': [],
},
format='json'
)
assert resp.status_code == 201
tl = env[0].ticket_layouts.get(pk=resp.data["id"])
assert tl.default
@pytest.mark.django_db
def test_api_create_validate_layout(env, token_client):
@@ -232,6 +247,18 @@ def test_api_update_validate_default(env, token_client):
assert resp.status_code == 400
assert resp.data == {"non_field_errors": ["You cannot have two layouts with default = True"]}
env[0].ticket_layouts.filter(default=True).update(default=False)
resp = token_client.patch(
'/api/v1/organizers/{}/events/{}/ticketlayouts/{}/'.format(env[0].slug, env[0].slug, tl2.pk),
{
"default": True,
},
format='json'
)
assert resp.status_code == 200
tl2.refresh_from_db()
assert tl2.default
@pytest.mark.django_db
def test_api_delete(env, token_client):
@@ -329,3 +356,22 @@ def test_renderer_batch_invalid(env, token_client, position):
)
assert resp.status_code == 400
assert resp.data == {"parts": ["Please do not submit more than 1000 parts."]}
@pytest.mark.django_db
def test_api_permission(env, token_client):
t = env[0].organizer.teams.get()
t.limit_event_permissions = {"event.orders:read": True}
t.all_event_permissions = False
t.save()
resp = token_client.patch(
'/api/v1/organizers/{}/events/{}/ticketlayouts/{}/'.format(env[0].slug, env[0].slug, env[1].pk),
{
"name": "Bar",
"layout": [
{"type": "barcodearea", "left": "7.00", "bottom": "11.15", "size": "45.00", "content": "secret"}
]
},
format='json'
)
assert resp.status_code == 403
+11 -3
View File
@@ -30,7 +30,10 @@ from urllib.parse import quote
import jwt
import pytest
from bs4 import BeautifulSoup
from Crypto.PublicKey import RSA
from cryptography.hazmat.primitives.asymmetric.rsa import (
RSAPublicKey, RSAPublicNumbers,
)
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
from django.utils.timezone import now
from django_scopes import scopes_disabled
from freezegun import freeze_time
@@ -691,6 +694,11 @@ def test_keys_endpoint(env, client, ssoclient):
e = decode_int(data['keys'][0]['e'])
n = decode_int(data['keys'][0]['n'])
pubkey = RSA.construct((n, e))
representation = pubkey.export_key('PEM').decode()
pubkey = RSAPublicNumbers(e, n).public_key()
assert isinstance(pubkey, RSAPublicKey)
representation = pubkey.public_bytes(
Encoding.PEM, PublicFormat.SubjectPublicKeyInfo
).decode()
assert representation.strip() == env[0].settings.sso_server_signing_key_rsa256_public.strip()
+31 -26
View File
@@ -422,37 +422,42 @@ class OrdersTest(BaseOrdersTest):
with scopes_disabled():
assert self.order.invoices.count() == 1
response = self.client.post(
'/%s/%s/order/%s/%s/modify' % (self.orga.slug, self.event.slug, self.order.code, self.order.secret), {
'%s-question_%s' % (self.ticket_pos.id, self.question.id): 'ABC',
'zipcode': '12345',
'street': 'Main Street',
'city': 'Heidelberg',
'country': 'DE',
'transmission_type': 'email',
}, follow=True)
self.assertRedirects(response,
'/%s/%s/order/%s/%s/' % (self.orga.slug, self.event.slug, self.order.code,
self.order.secret),
target_status_code=200)
with self.captureOnCommitCallbacks(execute=True):
response = self.client.post(
'/%s/%s/order/%s/%s/modify' % (self.orga.slug, self.event.slug, self.order.code, self.order.secret), {
'%s-question_%s' % (self.ticket_pos.id, self.question.id): 'ABC',
'zipcode': '12345',
'street': 'Main Street',
'city': 'Heidelberg',
'country': 'DE',
'transmission_type': 'email',
}, follow=True)
self.assertRedirects(response,
'/%s/%s/order/%s/%s/' % (self.orga.slug, self.event.slug, self.order.code,
self.order.secret),
target_status_code=200)
with scopes_disabled():
assert self.order.invoices.count() == 3
last_two = self.order.invoices.order_by('-pk')[:2]
for inv in last_two:
assert inv.transmission_status != Invoice.TRANSMISSION_STATUS_PENDING
self.event.settings.set('invoice_reissue_after_modify', False)
response = self.client.post(
'/%s/%s/order/%s/%s/modify' % (self.orga.slug, self.event.slug, self.order.code, self.order.secret), {
'%s-question_%s' % (self.ticket_pos.id, self.question.id): 'ABC',
'zipcode': '54321',
'street': 'Main Street',
'city': 'Heidelberg',
'country': 'DE',
'transmission_type': 'email',
}, follow=True)
self.assertRedirects(response,
'/%s/%s/order/%s/%s/' % (self.orga.slug, self.event.slug, self.order.code,
self.order.secret),
target_status_code=200)
with self.captureOnCommitCallbacks(execute=True):
response = self.client.post(
'/%s/%s/order/%s/%s/modify' % (self.orga.slug, self.event.slug, self.order.code, self.order.secret), {
'%s-question_%s' % (self.ticket_pos.id, self.question.id): 'ABC',
'zipcode': '54321',
'street': 'Main Street',
'city': 'Heidelberg',
'country': 'DE',
'transmission_type': 'email',
}, follow=True)
self.assertRedirects(response,
'/%s/%s/order/%s/%s/' % (self.orga.slug, self.event.slug, self.order.code,
self.order.secret),
target_status_code=200)
with scopes_disabled():
assert self.order.invoices.count() == 3