Allow to use a custom domain per event (#1617)

* Drop support for maindomain_urls/subdomain_urls in plugins

* Allow to use a custom domain per event

* Fix bug when manually saving domains

* Fix custom domains in debugging

* Fix middleware

* Fix middleware again, update docs
This commit is contained in:
Raphael Michel
2020-03-23 13:03:14 +01:00
committed by GitHub
parent ac2fc2de5c
commit 7e9c9beace
19 changed files with 386 additions and 89 deletions

View File

@@ -20,7 +20,9 @@ from pretix.base.services.tasks import (
TransactionAwareProfiledEventTask, TransactionAwareTask,
)
from pretix.celery_app import app
from pretix.multidomain.urlreverse import get_domain
from pretix.multidomain.urlreverse import (
get_event_domain, get_organizer_domain,
)
from pretix.presale.signals import sass_postamble, sass_preamble
logger = logging.getLogger('pretix.presale.style')
@@ -33,7 +35,10 @@ def compile_scss(object, file="main.scss", fonts=True):
def static(path):
sp = _static(path)
if not settings.MEDIA_URL.startswith("/") and sp.startswith("/"):
domain = get_domain(object.organizer if isinstance(object, Event) else object)
if isinstance(object, Event):
domain = get_event_domain(object, fallback=True)
else:
domain = get_organizer_domain(object)
if domain:
siteurlsplit = urlsplit(settings.SITE_URL)
if siteurlsplit.port and siteurlsplit.port not in (80, 443):