Skip to content

Commit e004128

Browse files
committed
Ensure super expert and NS have assignations to identification task classified by AI
1 parent 967e94e commit e004128

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tigacrafting/models.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,16 @@ def save(self, *args, **kwargs):
721721
if not self.report.is_browsable:
722722
self.status = self.Status.ARCHIVED
723723

724-
return super().save(*args, **kwargs)
724+
super().save(*args, **kwargs)
725+
726+
if self.result_source == self.ResultSource.AI:
727+
# Ensure that superexpert and national supervisor can see in old entolab.
728+
# TODO: remove this when old entolab is removed.
729+
if superexpert := User.objects.filter(pk=25).first():
730+
self.assign_to_user(user=superexpert)
731+
if country := self.report.country:
732+
for ns in UserStat.objects.filter(national_supervisor_of=country).select_related('user'):
733+
self.assign_to_user(user=ns.user)
725734

726735
class Meta:
727736
permissions = [

0 commit comments

Comments
 (0)