2017-03-20 04:11:50 +01:00
|
|
|
from django.contrib.auth.decorators import user_passes_test
|
2016-09-01 00:45:44 +02:00
|
|
|
|
2016-08-31 02:52:13 +02:00
|
|
|
|
|
|
|
def kfet_is_team(user):
|
2021-02-24 00:28:17 +01:00
|
|
|
if (
|
|
|
|
hasattr(user, "profile")
|
|
|
|
and hasattr(user.profile, "account_kfet")
|
|
|
|
and user.profile.account_kfet.is_frozen
|
|
|
|
):
|
2021-02-24 00:25:48 +01:00
|
|
|
return False
|
|
|
|
|
2018-10-06 12:35:49 +02:00
|
|
|
return user.has_perm("kfet.is_team")
|
|
|
|
|
2016-08-31 02:52:13 +02:00
|
|
|
|
2017-03-21 00:24:44 +01:00
|
|
|
teamkfet_required = user_passes_test(kfet_is_team)
|