20 lines
499 B
Python
20 lines
499 B
Python
from django_cas.decorators import user_passes_test
|
|
|
|
def is_cof(user):
|
|
try:
|
|
profile = user.profile
|
|
return profile.is_cof
|
|
except:
|
|
return False
|
|
|
|
cof_required = user_passes_test(lambda u: is_cof(u))
|
|
cof_required_customdenied = user_passes_test(lambda u: is_cof(u), login_url = "cof-denied")
|
|
|
|
def is_buro(user):
|
|
try:
|
|
profile = user.profile
|
|
return profile.is_buro
|
|
except:
|
|
return False
|
|
|
|
buro_required = user_passes_test(lambda u: is_buro(u))
|