Fix .je_org a .je_resitel

This commit is contained in:
Pavel "LEdoian" Turinsky 2021-02-23 23:28:33 +01:00
parent c92b0ea4e0
commit 970d363689

View file

@ -17,10 +17,11 @@ import seminar.treelib as t
org_required = permission_required('auth.org', raise_exception=True) org_required = permission_required('auth.org', raise_exception=True)
resitel_required = permission_required('auth.resitel', raise_exception=True) resitel_required = permission_required('auth.resitel', raise_exception=True)
User = get_user_model() User = get_user_model()
User.je_org = lambda self: self.has_perm('auth.org') # Není to úplně hezké, ale budeme doufat, že to je funkční...
User.je_resitel = lambda self: self.has_perm('auth.resitel') User.je_org = property(lambda self: self.has_perm('auth.org'))
AnonymousUser.je_org = lambda self: False User.je_resitel = property(lambda self: self.has_perm('auth.resitel'))
AnonymousUser.je_resitel = lambda self: False AnonymousUser.je_org = False
AnonymousUser.je_resitel = False
class FirstTagParser(HTMLParser): class FirstTagParser(HTMLParser):