mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Allow to access not-yet-live shop on different domain
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from decimal import Decimal
|
||||
from importlib import import_module
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.db.models import Sum
|
||||
@@ -17,6 +19,7 @@ from pretix.control.signals import (
|
||||
|
||||
from ..logdisplay import OVERVIEW_BLACKLIST
|
||||
|
||||
SessionStore = import_module(settings.SESSION_ENGINE).SessionStore
|
||||
NUM_WIDGET = '<div class="numwidget"><span class="num">{num}</span><span class="text">{text}</span></div>'
|
||||
|
||||
|
||||
@@ -167,11 +170,21 @@ def event_index(request, organizer, event):
|
||||
|
||||
a_qs = request.event.requiredaction_set.filter(done=False)
|
||||
|
||||
has_domain = request.event.organizer.domains.exists()
|
||||
|
||||
ctx = {
|
||||
'widgets': rearrange(widgets),
|
||||
'logs': qs[:5],
|
||||
'actions': a_qs[:5] if request.eventperm.can_change_orders else []
|
||||
'actions': a_qs[:5] if request.eventperm.can_change_orders else [],
|
||||
'has_domain': has_domain
|
||||
}
|
||||
|
||||
if not request.event.live and has_domain:
|
||||
s = SessionStore()
|
||||
s['pretix_event_access_{}'.format(request.event.pk)] = request.session.session_key
|
||||
s.create()
|
||||
ctx['new_session'] = s.session_key
|
||||
|
||||
for a in ctx['actions']:
|
||||
a.display = a.display(request)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user