2016-07-15 00:02:56 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from __future__ import division
|
|
|
|
from __future__ import print_function
|
2016-05-26 22:44:10 +02:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
2016-05-26 22:20:04 +02:00
|
|
|
from django_cas_ng.decorators import user_passes_test
|
2012-07-11 17:39:20 +02:00
|
|
|
|
2016-07-09 21:19:37 +02:00
|
|
|
|
2012-07-11 17:39:20 +02:00
|
|
|
def is_cof(user):
|
|
|
|
try:
|
2017-02-11 17:21:59 +01:00
|
|
|
cofprofile = user.profile.cof
|
|
|
|
return cofprofile.is_cof
|
2012-07-11 17:39:20 +02:00
|
|
|
except:
|
|
|
|
return False
|
|
|
|
|
2013-09-05 22:20:52 +02:00
|
|
|
cof_required = user_passes_test(lambda u: is_cof(u))
|
2016-07-09 22:31:56 +02:00
|
|
|
cof_required_customdenied = user_passes_test(lambda u: is_cof(u),
|
|
|
|
login_url="cof-denied")
|
2016-07-09 21:19:37 +02:00
|
|
|
|
2012-07-11 17:39:20 +02:00
|
|
|
|
|
|
|
def is_buro(user):
|
|
|
|
try:
|
2017-02-11 17:21:59 +01:00
|
|
|
cofprofile = user.profile.cof
|
|
|
|
return cofprofile.is_buro
|
2012-07-11 17:39:20 +02:00
|
|
|
except:
|
|
|
|
return False
|
|
|
|
|
2013-09-05 22:20:52 +02:00
|
|
|
buro_required = user_passes_test(lambda u: is_buro(u))
|