mirror of
https://github.com/pretix/pretix.git
synced 2026-08-20 12:26:27 +00:00
Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
019551fc19 | ||
|
|
2ee49dfa14 | ||
|
|
65c774c1f6 | ||
|
|
a9de7a5b12 | ||
|
|
50c61b038c | ||
|
|
f26f9821ad | ||
|
|
9f697a296e | ||
|
|
ff6d2767b4 | ||
|
|
9d997f6509 | ||
|
|
f7a292debd | ||
|
|
6881ed47a2 |
@@ -0,0 +1,45 @@
|
||||
name: SBOM
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, sbom ]
|
||||
tags: [ 'v.*' ]
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
env:
|
||||
FORCE_COLOR: 1
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-22.04
|
||||
name: Submission
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: '24.x'
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
- name: Install system dependencies
|
||||
run: sudo apt update && sudo apt install -y gettext unzip
|
||||
- name: Install Python dependencies
|
||||
run: pip3 install -U "prisma-sbom-submit[python]"
|
||||
- name: Test
|
||||
run: /opt/hostedtoolcache/node/24.18.0/x64/bin/npm install --global @cyclonedx/cyclonedx-npm
|
||||
- name: Create SBOM
|
||||
run: NPM=$(which npm) prisma-sbom-submit collect . sbom.json
|
||||
- name: Submit SBOM
|
||||
run: prisma-sbom-submit upload --server https://prisma.pretix.com sbom.json
|
||||
env:
|
||||
PRISMA_UPLOAD_TOKEN: ${{ secrets.PRISMA_UPLOAD_TOKEN }}
|
||||
+1
-1
@@ -91,7 +91,7 @@ dependencies = [
|
||||
"pytz-deprecation-shim==0.1.*",
|
||||
"pyuca",
|
||||
"qrcode==8.2",
|
||||
"redis==8.1.*",
|
||||
"redis==7.4.*",
|
||||
"reportlab==5.0.*",
|
||||
"requests==2.34.*",
|
||||
"sentry-sdk==2.66.*",
|
||||
|
||||
@@ -104,7 +104,6 @@ ALL_LANGUAGES = [
|
||||
('gl', _('Galician')),
|
||||
('el', _('Greek')),
|
||||
('he', _('Hebrew')),
|
||||
('hu', _('Hungarian')),
|
||||
('id', _('Indonesian')),
|
||||
('it', _('Italian')),
|
||||
('ja', _('Japanese')),
|
||||
|
||||
@@ -53,7 +53,6 @@ from django.utils.translation import (
|
||||
)
|
||||
from django_scopes import scopes_disabled
|
||||
|
||||
from pretix.base.decimal import round_decimal
|
||||
from pretix.base.i18n import language
|
||||
from pretix.base.media import MEDIA_TYPES
|
||||
from pretix.base.models import (
|
||||
@@ -917,8 +916,6 @@ class CartManager:
|
||||
if custom_price > 99_999_999_999:
|
||||
raise CartError(error_messages['price_too_high'])
|
||||
|
||||
custom_price = round_decimal(custom_price, currency=self.event.currency)
|
||||
|
||||
op = self.AddOperation(
|
||||
count=i['count'],
|
||||
item=item,
|
||||
@@ -1041,8 +1038,6 @@ class CartManager:
|
||||
if custom_price > 99_999_999_999:
|
||||
raise CartError(error_messages['price_too_high'])
|
||||
|
||||
custom_price = round_decimal(custom_price, currency=self.event.currency)
|
||||
|
||||
# Fix positions with wrong price (TODO: happens out-of-cartmanager-transaction and therefore a little hacky)
|
||||
for ca in current_addons[cp][a['item'], a['variation']]:
|
||||
if ca.listed_price != listed_price:
|
||||
|
||||
@@ -697,42 +697,6 @@ class CartTest(CartTestMixin, TestCase):
|
||||
self.assertIsNone(objs[0].variation)
|
||||
self.assertEqual(objs[0].price, 23)
|
||||
|
||||
def test_free_price_rounding(self):
|
||||
self.ticket.free_price = True
|
||||
self.ticket.save()
|
||||
|
||||
response = self.client.post('/%s/%s/cart/add' % (self.orga.slug, self.event.slug), {
|
||||
'item_%d' % self.ticket.id: '1',
|
||||
'price_%d' % self.ticket.id: '40.1234',
|
||||
}, follow=True)
|
||||
self.assertRedirects(response, '/%s/%s/?require_cookie=true' % (self.orga.slug, self.event.slug),
|
||||
target_status_code=200)
|
||||
|
||||
with scopes_disabled():
|
||||
cr1 = CartPosition.objects.get()
|
||||
assert cr1.listed_price == Decimal('23.00')
|
||||
assert cr1.custom_price_input == Decimal('40.12')
|
||||
assert cr1.price == Decimal('40.12')
|
||||
|
||||
def test_free_price_rounding_jpy(self):
|
||||
self.event.currency = "JPY"
|
||||
self.event.save()
|
||||
self.ticket.free_price = True
|
||||
self.ticket.save()
|
||||
|
||||
response = self.client.post('/%s/%s/cart/add' % (self.orga.slug, self.event.slug), {
|
||||
'item_%d' % self.ticket.id: '1',
|
||||
'price_%d' % self.ticket.id: '40.1234',
|
||||
}, follow=True)
|
||||
self.assertRedirects(response, '/%s/%s/?require_cookie=true' % (self.orga.slug, self.event.slug),
|
||||
target_status_code=200)
|
||||
|
||||
with scopes_disabled():
|
||||
cr1 = CartPosition.objects.get()
|
||||
assert cr1.listed_price == Decimal('23.00')
|
||||
assert cr1.custom_price_input == Decimal('40.00')
|
||||
assert cr1.price == Decimal('40.00')
|
||||
|
||||
def test_variation_inactive(self):
|
||||
self.shirt_red.active = False
|
||||
self.shirt_red.save()
|
||||
@@ -3096,31 +3060,6 @@ class CartAddonTest(CartTestMixin, TestCase):
|
||||
assert cp1.addons.count() == 3
|
||||
assert all(a.price == Decimal('12.00') for a in cp1.addons.all())
|
||||
|
||||
@classscope(attr='orga')
|
||||
def test_free_price_rounding(self):
|
||||
self.event.settings.locales = ['de']
|
||||
self.event.settings.locale = 'de'
|
||||
self.event.currency = "JPY"
|
||||
self.event.save()
|
||||
|
||||
self.workshop1.free_price = True
|
||||
self.workshop1.save()
|
||||
cp1 = CartPosition.objects.create(
|
||||
event=self.event, cart_id=self.session_key, item=self.ticket,
|
||||
price=23, expires=now() - timedelta(minutes=10)
|
||||
)
|
||||
|
||||
response = self.client.post('/%s/%s/checkout/addons/' % (self.orga.slug, self.event.slug), {
|
||||
'cp_{}_item_{}'.format(cp1.pk, self.workshop1.pk): '1',
|
||||
'cp_{}_item_{}_price'.format(cp1.pk, self.workshop1.pk): '99,99',
|
||||
}, follow=True)
|
||||
self.assertRedirects(response, '/%s/%s/checkout/questions/' % (self.orga.slug, self.event.slug),
|
||||
target_status_code=200)
|
||||
with scopes_disabled():
|
||||
assert cp1.addons.count() == 1
|
||||
assert cp1.addons.first().item == self.workshop1
|
||||
assert cp1.addons.first().price == Decimal('100')
|
||||
|
||||
@classscope(attr='orga')
|
||||
def test_change_number(self):
|
||||
cp1 = CartPosition.objects.create(
|
||||
|
||||
Reference in New Issue
Block a user