mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-10-08 13:35:25 +00:00
* Allow technicians to record training sessions Add a per-item technician_can_train flag. Technicians in an item's department who are passed out on a flagged item may log Training Started/Complete for it. * Run linter
10 lines
366 B
Python
10 lines
366 B
Python
from PyRIGS.decorators import user_passes_test_with_403
|
|
|
|
|
|
def is_supervisor(login_url=None, oembed_view=None):
|
|
return user_passes_test_with_403(lambda u: hasattr(u, "is_supervisor") and u.is_supervisor)
|
|
|
|
|
|
def is_supervisor_or_technician(login_url=None, oembed_view=None):
|
|
return user_passes_test_with_403(lambda u: u.is_authenticated and u.can_log_training)
|