Unit Tests should create enabled events

This commit is contained in:
Raphael Michel
2016-02-23 08:58:39 +01:00
parent b1715fc442
commit c28b40a118
9 changed files with 15 additions and 10 deletions

View File

@@ -55,7 +55,7 @@ class EventMiddleware:
path = request.get_full_path().split("/", 2)[-1]
return redirect(urljoin('%s://%s' % (request.scheme, domain), path))
if not request.event.live:
if hasattr(request, 'event') and not request.event.live:
if not request.user.is_authenticated() or not EventPermission.objects.filter(
event=request.event, user=request.user).exists():
raise PermissionDenied(_('The selected ticket shop is currently not available.'))