Skip to content

Commit

Permalink
update migration for badge to create missing size column (fossasia#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcduong authored Oct 8, 2024
1 parent 48cea1c commit 6233d61
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/pretix/plugins/badges/migrations/0002_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ class Migration(migrations.Migration):
]

operations = [
migrations.AddField(
model_name='badgelayout',
name='size',
field=models.TextField(default='[{"width": 148, "height": 105, "orientation": "portrait"}]'),
),
migrations.AddField(
model_name='badgelayout',
name='event',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 4.2.16 on 2024-10-08 04:57

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("badges", "0002_initial"),
]

operations = [
migrations.AddField(
model_name='badgelayout',
name='size',
field=models.TextField(default='[{"width": 148, "height": 105, "orientation": "portrait"}]'),
),
migrations.AlterField(
model_name="badgeitem",
name="id",
field=models.BigAutoField(
auto_created=True, primary_key=True, serialize=False
),
),
migrations.AlterField(
model_name="badgelayout",
name="id",
field=models.BigAutoField(
auto_created=True, primary_key=True, serialize=False
),
),
migrations.AlterField(
model_name="badgelayout",
name="size",
field=models.TextField(
default='[{"width": 148, "height": 105, "orientation": "landscape"}]'
),
),
]
7 changes: 4 additions & 3 deletions src/pretix/presale/checkoutflowstep/payment_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def provider_forms(self):

# Calculate fee and form
fee = provider.calculate_fee(self._total_order_value)
form_params = self._total_order_value + fee if 'total' in inspect.signature(
provider.payment_form_render).parameters else None

form = provider.payment_form_render(self.request, form_params)
if 'total' in inspect.signature(provider.payment_form_render).parameters:
form = provider.payment_form_render(self.request, self._total_order_value + fee)
else:
form = provider.payment_form_render(self.request)

# Append provider info to list
providers.append({
Expand Down

0 comments on commit 6233d61

Please sign in to comment.