Allow technicians to record training sessions (#664)

* 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
This commit is contained in:
Joe Banks
2026-10-03 16:10:13 +01:00
committed by GitHub
parent abfc394088
commit 435e6688e1
11 changed files with 191 additions and 8 deletions

View File

@@ -47,6 +47,12 @@ class Profile(AbstractUser):
reversion_hide = True
@property
def can_log_training(self):
from training.models import Trainee
return self.is_supervisor or Trainee.objects.get(pk=self.pk).is_technician
@classmethod
def make_api_key(cls):
size = 20