A plugin for pretix allowing automated validation of ESNcard numbers
Project description
ESNcard Validity Checker
A plugin for Pretix allowing automated validation of ESNcard numbers.
Installation
Make sure to run from Pretix's virtual environment:
sudo -u pretix -s
source /var/pretix/venv/bin/activate
Install the package and update the database:
pip3 install pretix-esncard
python -m pretix migrate
python -m pretix rebuild
Restart Pretix:
sudo systemctl restart pretix-web pretix-worker
For more information about plugin installation, see the Pretix documentation.
Usage
Setup
Activate the plugin from the organizer or event settings.
Go to Products > Questions and select "Create a new question"
- Question: "ESNcard number"
- Type: Text (one line)
- Products: Select all product which have an ESNcard discount
- Check "required question"
Go to the Advanced tab
Optionally write a help text such as the following:
If you have issues proceeding due to your ESNcard, please make sure it is registered on ESNcard.org and that you type it correctly (do not include any spaces etc).
If you just registered your card, it may take up to 4 hours until it shows up in our system!
Internal identifier: esncard
[!NOTE] You must write exactly this identifier for the plugin to work.
Validation
The ESNcard number is validated against the ESNcard API during checkout and the customer is notified of any errors.
Development
-
Make sure that you have a working pretix development setup
-
Clone this repository.
-
Activate the virtual environment you use for pretix development.
-
Execute
python setup.py developwithin this directory to register this application with pretix's plugin registry. -
Restart your local pretix server. You can now use the plugin from this repository for your events by enabling it in the 'plugins' tab in the settings.
This plugin has CI set up to enforce a few code style rules. To check locally, you need these packages installed:
pip install flake8 isort black
To check your plugin for rule violations, run:
black --check .
isort -c .
flake8 .
You can auto-fix some of these issues by running:
isort .
black .
To automatically check for these issues before you commit, you can run .install-hooks.
License
Copyright 2023 ESN Sea Battle OC
Released under the terms of the Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pretix_esncard-1.1.3.post1.tar.gz.
File metadata
- Download URL: pretix_esncard-1.1.3.post1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1398ac4b702a97400df2adb5961265502a3c29590146349db3931991e84aeb7b
|
|
| MD5 |
7cf0bceb0a9c0ca417be2f43d902e3c0
|
|
| BLAKE2b-256 |
986f0117f6cdf77e2d509bc13ef6e48a4106ee0252fabe923618f80605979a5b
|
File details
Details for the file pretix_esncard-1.1.3.post1-py3-none-any.whl.
File metadata
- Download URL: pretix_esncard-1.1.3.post1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca8e2ae6a6d2656dbbf4418f05e86eb53606983781361d8e60bca775027951af
|
|
| MD5 |
315ad0b355f38a7190d707762265e2eb
|
|
| BLAKE2b-256 |
c24ccc32e04c98f10c5baebff5170cba8aff5ecfe80908c4733262f126d7e59e
|