Skip to main content

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 products with an ESNcard discount
  • Check "required question"

Go to the Advanced tab

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.

The validation fails if the entered ESNcard number:

  • is not found
  • is expired
  • is unregistered (the user must register their card on esncard.org)
  • is used several times in the same order (each person must have their own ESNcard)

Cloudflare bypass token

To avoid getting blocked by Cloudflare when sending many requests, you may ask the WPA of ESN International for a bypass token which you can configure in the global Pretix settings. You can access the global settings by enabling admin mode and look for the option in the bottom of the left sidebar.

Development

Environment

  1. Make sure that you have a working pretix development setup

  2. Clone this repository.

  3. Activate the virtual environment you use for pretix development.

  4. Execute python setup.py develop within this directory to register this application with pretix's plugin registry.

  5. 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.

Linting

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pretix_esncard-1.2.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pretix_esncard-1.2.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file pretix_esncard-1.2.0.tar.gz.

File metadata

  • Download URL: pretix_esncard-1.2.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for pretix_esncard-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0c69fe3593c722da487241f1d1bac193b368cf511644618b05e680c8c19dcdb4
MD5 085ffd90696687e4f21a46fa69281056
BLAKE2b-256 ffed63bff0c888a18833104329683577512ce76a8bec865bb8b66f5b76643528

See more details on using hashes here.

File details

Details for the file pretix_esncard-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pretix_esncard-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for pretix_esncard-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 82cc4590e83023a3b9879c9134556d2c168aed9a07e2fd83073c4d394fe02f51
MD5 812191b51759e30f83c9ca1658e4b643
BLAKE2b-256 e0e2ada08313bd9e639c82c2da2748280837c506f03a985141fb02cba76c07f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page