Fix decorator
This commit is contained in:
parent
93d283fecb
commit
a947b9d3f2
1 changed files with 5 additions and 1 deletions
|
@ -2,7 +2,11 @@ from django.contrib.auth.decorators import user_passes_test
|
||||||
|
|
||||||
|
|
||||||
def kfet_is_team(user):
|
def kfet_is_team(user):
|
||||||
if hasattr(user.profile, "account_kfet") and user.profile.account_kfet.is_frozen:
|
if (
|
||||||
|
hasattr(user, "profile")
|
||||||
|
and hasattr(user.profile, "account_kfet")
|
||||||
|
and user.profile.account_kfet.is_frozen
|
||||||
|
):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return user.has_perm("kfet.is_team")
|
return user.has_perm("kfet.is_team")
|
||||||
|
|
Loading…
Reference in a new issue