15 lines
349 B
Python
15 lines
349 B
Python
from django.contrib.auth.decorators import user_passes_test
|
|
|
|
|
|
def kfet_is_team(user):
|
|
if (
|
|
hasattr(user, "profile")
|
|
and hasattr(user.profile, "account_kfet")
|
|
and user.profile.account_kfet.is_frozen
|
|
):
|
|
return False
|
|
|
|
return user.has_perm("kfet.is_team")
|
|
|
|
|
|
teamkfet_required = user_passes_test(kfet_is_team)
|