Files
pretix_original/src/pretix/testutils/scope.py
Raphael Michel d85ddb5bda Integrate django-scopes (#1319)
* Install django-scopes

* Fix tests.api

* Update tasks and cronjobs

* Fix remaining tests

* Remove unused import

* Fix tests after rebase

* Disable scopes for get_Events_with_any_permission

* Disable scopes for a management command
2019-06-17 10:46:55 +02:00

11 lines
265 B
Python

from django_scopes import scope
def classscope(attr='o'):
def wrap(fn):
def wrapped(self, *args, **kwargs):
with scope(organizer=getattr(self, attr)):
return fn(self, *args, **kwargs)
return wrapped
return wrap