2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 23:31:52 +00:00
troggle/helper/__init__.py

15 lines
351 B
Python
Raw Normal View History

from django.contrib.auth.decorators import login_required
from django.conf import settings
class login_required_if_public(object):
def __init__(self, f):
if settings.PUBLIC_SITE:
self.f = login_required(f)
else:
self.f = f
def __call__(self, *args, **kwargs):
return self.f(*args, **kwargs)