Consistently set default background PDFs on server, not client (#2840)

Co-authored-by: Martin Gross <gross@rami.io>
This commit is contained in:
Raphael Michel
2022-10-06 14:14:56 +02:00
committed by GitHub
parent b5bd98336a
commit c4b7aeaaa2
6 changed files with 72 additions and 3 deletions

View File

@@ -34,7 +34,7 @@
from django.apps import AppConfig
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from django.utils.translation import gettext, gettext_lazy as _
from pretix import __version__ as version
@@ -63,3 +63,11 @@ class TicketOutputPdfApp(AppConfig):
except ImportError:
errs.append("Python package 'reportlab' is not installed.")
return errs
def installed(self, event):
event.ticket_layouts.get_or_create(
default=True,
defaults={
'name': gettext('Default layout'),
}
)