Skip to content

Commit 738a5ae

Browse files
committed
Let upload creator follow the upload
1 parent 6c39df5 commit 738a5ae

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

app/grandchallenge/cases/models.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,14 +1086,26 @@ def __init__(self, *args, **kwargs):
10861086
self.__s3_client = None
10871087

10881088
def save(self, *args, **kwargs):
1089+
adding = self._state.adding
1090+
10891091
self.study_instance_uid = generate_dicom_id_suffix(
10901092
pk=self.pk, suffix_type="study"
10911093
)
10921094
self.series_instance_uid = generate_dicom_id_suffix(
10931095
pk=self.pk, suffix_type="series"
10941096
)
1097+
10951098
super().save(*args, **kwargs)
10961099

1100+
if adding:
1101+
if self.creator:
1102+
follow(
1103+
user=self.creator,
1104+
obj=self,
1105+
send_action=False,
1106+
actor_only=False,
1107+
)
1108+
10971109
@property
10981110
def _s3_client(self):
10991111
if self.__s3_client is None:
@@ -1143,7 +1155,7 @@ def mark_failed(self, *, error_message, exc=None):
11431155
kind=NotificationTypeChoices.IMAGE_IMPORT_STATUS,
11441156
message="DICOM import failed.",
11451157
description=error_message,
1146-
actor=self.creator,
1158+
action_object=self,
11471159
)
11481160

11491161
def start_dicom_import_job(self):

0 commit comments

Comments
 (0)