mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-03-22 01:19:28 +01:00
16 lines
362 B
Python
16 lines
362 B
Python
from functools import wraps
|
|
|
|
from django.conf import settings
|
|
from django.core.exceptions import PermissionDenied
|
|
|
|
|
|
def disabled_on_demo(view):
|
|
@wraps(view)
|
|
def _view(request, *args, **kwargs):
|
|
if settings.DEMO and not request.user.is_superuser:
|
|
raise PermissionDenied
|
|
|
|
return view(request, *args, **kwargs)
|
|
|
|
return _view
|