Use django.contrib.auth decorators

This commit is contained in:
Ludovic Stephan 2017-03-20 00:11:50 -03:00
parent a057869d77
commit 2c63e6b667
2 changed files with 2 additions and 11 deletions

View file

@ -1,10 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django_cas_ng.decorators import user_passes_test
from django.contrib.auth.decorators import user_passes_test
def is_cof(user):
@ -15,8 +11,6 @@ def is_cof(user):
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):

View file

@ -1,10 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.contrib.auth.decorators import user_passes_test
from django_cas_ng.decorators import user_passes_test
def kfet_is_team(user):
return user.has_perm('kfet.is_team')