Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change code #1

Open
wants to merge 41 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fb7bfb6
Replace deprecated PdfMerger with PdfWriter (#173)
odkhang Jun 19, 2024
ef7b99c
Update Stripe to more recent version (#167)
lcduong Jun 20, 2024
8c8416a
Upgrade to recent 2.x VueJS (#177)
lcduong Jun 20, 2024
0d68953
Upgrade to Python 3.11 (#184)
lcduong Jun 21, 2024
4d82a91
optimize package import for stripe update (#198)
lcduong Jun 21, 2024
7ecacaa
Add orientation and height fields to Badgelayouts API response (#197)
Sak1012 Jun 21, 2024
100fd79
Merge branch 'master' into development
norbusan Jun 21, 2024
e27f132
Update Stripe to more recent version (#167)
lcduong Jun 20, 2024
ebf5c37
Upgrade to recent 2.x VueJS (#177)
lcduong Jun 20, 2024
703314a
Upgrade to Python 3.11 (#184)
lcduong Jun 21, 2024
f370c39
optimize package import for stripe update (#198)
lcduong Jun 21, 2024
201784c
Add orientation and height fields to Badgelayouts API response (#197)
Sak1012 Jun 21, 2024
146cf9c
Merge branch 'master' into development
norbusan Jun 21, 2024
fea6b17
Stripe plugin - correct template path (#201)
lcduong Jun 22, 2024
f98b9e0
Fix stripe incorrect gettext, update messages etc (#202)
norbusan Jun 22, 2024
569c78b
add support Ukrainan (#210)
lcduong Jun 25, 2024
abbde0c
support html / markdown for question title (#211)
lcduong Jun 25, 2024
c79035e
Merge pull request #212 from fossasia/development
mariobehling Jun 25, 2024
fab0799
Add text field as an option into the question page (#209)
lcduong Jun 26, 2024
8a21ac5
Hot fix Ukrainian language (#214)
lcduong Jun 26, 2024
f34d767
Merge pull request #216 from fossasia/development
mariobehling Jun 26, 2024
b626911
Hot fix Feature 171 (#218)
lcduong Jun 27, 2024
a292acb
Remove mariadb support (#183)
AviGawande Jun 27, 2024
19640c4
Improve flow for required field of Yes-No question (#206)
AviGawande Jul 1, 2024
326c3c2
Dynamic updation of Badge Size (#221)
Sak1012 Jul 2, 2024
e3480f8
Add plugins to autodeployment with docker (#208)
odkhang Jul 2, 2024
f6d88ff
Implement option to add link to privacy policy (#227)
odkhang Jul 3, 2024
7568897
Option to add customizable links to footer (#225)
lcduong Jul 8, 2024
052fa20
Replace pkg_resources (#232)
odkhang Jul 12, 2024
4ecc8f0
Do not repeat questions in form field of ticket form (#235)
odkhang Jul 13, 2024
5b5b64b
Added templates (#229)
Sak1012 Jul 13, 2024
4f81a16
Merge branch 'development'
marcoag Jul 13, 2024
93068bc
Implement customer accounts in system (#223)
odkhang Jul 14, 2024
fd9c2fd
Fix issue when create an event from other event configuration (#239)
odkhang Jul 14, 2024
048a39d
change default color for new organization (#240)
lcduong Jul 15, 2024
4d0b066
Implement Support for Sendgrid on a System and User Level (#195)
lcduong Jul 16, 2024
3558a8b
Use master branch in docker-pr workflow (#243)
norbusan Jul 17, 2024
e25a6e8
fix issue when send mail to invite member (#244)
lcduong Jul 17, 2024
63d245d
Allows tab IDs to be set in the HTML code (#247)
lcduong Jul 20, 2024
dcfd7a6
skip check for empty country (#246)
lcduong Jul 20, 2024
73117a8
change code
it-tma-tri Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docker PR Build

on:
pull_request:
branches: [development, main]
branches: [development, master]

jobs:
build_docker_image:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- uses: actions/cache@v1
with:
path: ~/.cache/pip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
name: Check gettext syntax
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- uses: actions/cache@v1
with:
path: ~/.cache/pip
Expand All @@ -43,10 +43,10 @@ jobs:
name: Spellcheck
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- uses: actions/cache@v1
with:
path: ~/.cache/pip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- uses: actions/cache@v1
with:
path: ~/.cache/pip
Expand All @@ -38,10 +38,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.11
- uses: actions/cache@v1
with:
path: ~/.cache/pip
Expand Down
20 changes: 6 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,16 @@ jobs:
name: Tests
strategy:
matrix:
python-version: [3.8]
database: [sqlite, postgres, mysql]
python-version: [3.11]
database: [sqlite, postgres]
exclude:
- database: mysql
python-version: 3.8
- database: sqlite
python-version: 3.8
python-version: 3.11
steps:
- uses: actions/checkout@v2
- uses: getong/[email protected]
with:
mariadb version: '10.4'
mysql database: 'pretix'
mysql root password: ''
if: matrix.database == 'mysql'
- uses: harmon758/postgresql-action@v1
with:
postgresql version: '11'
postgresql version: '12'
postgresql db: 'pretix'
postgresql user: 'postgres'
postgresql password: 'postgres'
Expand All @@ -51,7 +43,7 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- name: Install system dependencies
run: sudo apt update && sudo apt install gettext mysql-client
run: sudo apt update && sudo apt install gettext
- name: Install Python dependencies
run: pip3 install -e ".[dev]" psycopg2-binary
- name: Run checks
Expand All @@ -71,4 +63,4 @@ jobs:
with:
file: src/coverage.xml
fail_ci_if_error: true
if: matrix.database == 'postgres' && matrix.python-version == '3.8'
if: matrix.database == 'postgres' && matrix.python-version == '3.11'
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-bookworm
FROM python:3.11-bookworm

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -45,6 +45,7 @@ COPY deployment/docker/production_settings.py /pretix/src/production_settings.py
COPY pyproject.toml /pretix/pyproject.toml
COPY src /pretix/src

ENV DJANGO_SETTINGS_MODULE=
RUN pip3 install -U \
pip \
setuptools \
Expand All @@ -54,6 +55,7 @@ RUN pip3 install -U \
-e ".[memcached]" \
gunicorn django-extensions ipython && \
rm -rf ~/.cache/pip
ENV DJANGO_SETTINGS_MODULE=production_settings

RUN chmod +x /usr/local/bin/pretix && \
rm /etc/nginx/sites-enabled/default && \
Expand Down
2 changes: 1 addition & 1 deletion doc/admin/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Example::
port=3306

``backend``
One of ``sqlite3``, ``oracle`` and ``postgresql``.
One of ``sqlite3`` and ``postgresql``.
Default: ``sqlite3``.

``name``
Expand Down
5 changes: 2 additions & 3 deletions doc/admin/installation/general.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ To use pretix, you will need the following things:
* A periodic task runner, e.g. ``cron``

* **A database**. This needs to be a SQL-based that is supported by Django. We highly recommend to either
go for **PostgreSQL** or **MySQL/MariaDB**. If you do not provide one, pretix will run on SQLite, which is useful
go for **PostgreSQL**. If you do not provide one, pretix will run on SQLite, which is useful
for evaluation and development purposes.

.. warning:: Do not ever use SQLite in production. It will break.

.. warning:: We recommend **PostgreSQL**. If you go for MySQL, make sure you run **MySQL 5.7 or newer** or
**MariaDB 10.2.7 or newer**.
.. warning:: We recommend to use **PostgreSQL**.

* A **reverse proxy**. pretix needs to deliver some static content to your users (e.g. CSS, images, ...). While pretix
is capable of doing this, having this handled by a proper web server like **nginx** or **Apache** will be much
Expand Down
4 changes: 2 additions & 2 deletions doc/admin/installation/manual_smallscale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ installation guides):

* A SMTP server to send out mails, e.g. `Postfix`_ on your machine or some third-party server you have credentials for
* A HTTP reverse proxy, e.g. `nginx`_ or Apache to allow HTTPS connections
* A `PostgreSQL`_ 9.5+, `MySQL`_ 5.7+, or MariaDB 10.2.7+ database server
* A `PostgreSQL`_ 11+, `MySQL`_ 5.7+, or MariaDB 10.2.7+ database server
* A `redis`_ server
* A `nodejs_` installation

Expand Down Expand Up @@ -134,7 +134,7 @@ command if you're running MySQL::

(venv)$ pip3 install "pretix[postgres]" gunicorn

Note that you need Python 3.6 or newer. You can find out your Python version using ``python -V``.
Note that you need Python 3.11 or newer. You can find out your Python version using ``python -V``.

We also need to create a data directory::

Expand Down
2 changes: 1 addition & 1 deletion doc/plugins/badges.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Endpoints

.. sourcecode:: http

GET /api/v1/organizers/bigevents/events/democon/layoutsbadge/1/ HTTP/1.1
GET /api/v1/organizers/bigevents/events/democon/badgelayouts/1/ HTTP/1.1
Host: pretix.eu
Accept: application/json, text/javascript

Expand Down
19 changes: 13 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "eventyay"
dynamic = ["version"]
description = "the open source event solution"
readme = "README.rst"
requires-python = ">=3.8"
requires-python = ">=3.11"
license = {file = "LICENSE"}
keywords = ["tickets", "events", "web", "shop", "ecommerce"]
authors = [ {name = "eventyay", email = "[email protected]"}, ]
Expand All @@ -15,9 +15,8 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Environment :: Web Environment",
"License :: OSI Approved :: Apache License, Version 2.0",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Framework :: Django :: 3.2",
"Programming Language :: Python :: 3.11",
"Framework :: Django :: 4.2",
]
dependencies = [
'Django==4.2.*',
Expand Down Expand Up @@ -77,7 +76,7 @@ dependencies = [
'jsonschema',
'django-hijack==2.*',
'openpyxl==3.1.*',
'django-oauth-toolkit==1.6.*',
'django-oauth-toolkit==2.3.*',
'oauthlib==3.2.*',
'django-phonenumber-field==7.1.*',
'phonenumberslite==8.13.*',
Expand All @@ -88,7 +87,15 @@ dependencies = [
'text-unidecode==1.*',
'protobuf==4.23.*',
'cryptography>=3.4.2',
'pycryptodome==3.20.*',
'sepaxml==2.6.*',
'geoip2==4.*',
'paypalhttp==1.*',
'sendgrid==6.11.*',
'importlib_metadata==7.*',
'qrcode==7.4.*',
'pretix-pages @ git+https://github.com/fossasia/eventyay-ticket-pages.git@master',
'pretix-venueless @ git+https://github.com/fossasia/eventyay-ticket-video.git@master'
]

[project.optional-dependencies]
Expand Down Expand Up @@ -125,7 +132,7 @@ requires = [
'setuptools',
'setuptools-rust',
'wheel',
'importlib_metadata',
'importlib_metadata'
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.13 on 2024-07-09 08:13

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
('pretixapi', '0002_initial'),
]

operations = [
migrations.AddField(
model_name='oauthapplication',
name='post_logout_redirect_uris',
field=models.TextField(default=''),
),
]
10 changes: 8 additions & 2 deletions src/pretix/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)
from oauth2_provider.models import (
AbstractAccessToken, AbstractApplication, AbstractGrant, AbstractIDToken,
AbstractRefreshToken,
AbstractRefreshToken, ClientSecretField
)
from oauth2_provider.validators import URIValidator

Expand All @@ -21,11 +21,16 @@ class OAuthApplication(AbstractApplication):
verbose_name=_("Redirection URIs"),
help_text=_("Allowed URIs list, space separated")
)
post_logout_redirect_uris = models.TextField(
blank=True, validators=[URIValidator],
help_text=_("Allowed Post Logout URIs list with space separated"),
default="",
)
client_id = models.CharField(
verbose_name=_("Client ID"),
max_length=100, unique=True, default=generate_client_id, db_index=True
)
client_secret = models.CharField(
client_secret = ClientSecretField(
verbose_name=_("Client secret"),
max_length=255, blank=False, default=generate_client_secret, db_index=True
)
Expand All @@ -45,6 +50,7 @@ class OAuthGrant(AbstractGrant):
organizers = models.ManyToManyField('pretixbase.Organizer')
redirect_uri = models.CharField(max_length=2500) # Only 255 in AbstractGrant, which caused problems


class OAuthIDToken(AbstractIDToken):
application = models.ForeignKey(
OAuthApplication, on_delete=models.CASCADE,
Expand Down
41 changes: 41 additions & 0 deletions src/pretix/api/serializers/i18n.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.conf import settings
from django.core.validators import URLValidator
from i18nfield.fields import I18nCharField, I18nTextField
from i18nfield.strings import LazyI18nString
from rest_framework.exceptions import ValidationError
Expand Down Expand Up @@ -48,3 +49,43 @@ class I18nAwareModelSerializer(ModelSerializer):

I18nAwareModelSerializer.serializer_field_mapping[I18nCharField] = I18nField
I18nAwareModelSerializer.serializer_field_mapping[I18nTextField] = I18nField


class I18nURLField(I18nField):
"""
Custom field to handle internationalized URL inputs. It extends the I18nField
and ensures that all provided URLs are valid.

Methods:
to_internal_value(value: LazyI18nString) -> LazyI18nString:
Validates the URL(s) in the provided internationalized input.
"""

def to_internal_value(self, value) -> LazyI18nString:
"""
Converts and validates the internationalized URL input.

Args:
value (LazyI18nString): The input value to convert and validate.

Returns:
LazyI18nString: The converted and validated input value.

Raises:
ValidationError: If any of the URLs are invalid.
"""
value = super().to_internal_value(value)
if not value:
return value

url_validator = URLValidator()

if isinstance(value.data, dict):
for val in value.data.values():
if val:
url_validator(val)
else:
url_validator(value.data)

return value

Loading