Add an interaction test

Just one. Lol.
This commit is contained in:
2022-01-12 20:24:35 +00:00
parent aa6bb8410e
commit 7aba26218f
5 changed files with 94 additions and 5 deletions

View File

@@ -2,4 +2,4 @@ from PyRIGS.decorators import user_passes_test_with_403
def has_perm_or_supervisor(perm, login_url=None, oembed_view=None):
return user_passes_test_with_403(lambda u: u.is_supervisor or u.has_perm(perm), login_url=login_url, oembed_view=oembed_view)
return user_passes_test_with_403(lambda u: (hasattr(u, 'is_supervisor') and u.is_supervisor) or u.has_perm(perm), login_url=login_url, oembed_view=oembed_view)