ernestophone.ens.fr/partitions/decorators.py
Martin Pépin 69b0b13ad3 Nettoyage
- PEP8
- Fichiers inutilisés
2016-07-14 01:58:52 +02:00

11 lines
241 B
Python

from django.contrib.auth.decorators import user_passes_test
def is_chef(user):
try:
profile = user.profile
return profile.is_chef
except:
return False
chef_required = user_passes_test(lambda u: is_chef(u))