File tree 2 files changed +16
-1
lines changed
backend/src/openarchiefbeheer/destruction
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 9
9
from .constants import InternalStatus , ListItemStatus , ListStatus
10
10
from .models import DestructionList , DestructionListItem , ReviewResponse
11
11
from .signals import deletion_failure
12
+ from .utils import notify_assignees_successful_deletion
12
13
13
14
logger = logging .getLogger (__name__ )
14
15
@@ -104,4 +105,4 @@ def complete_and_notify(pk: int) -> None:
104
105
105
106
destruction_list .set_status (ListStatus .deleted )
106
107
107
- # TODO notify
108
+ notify_assignees_successful_deletion ( destruction_list )
Original file line number Diff line number Diff line change @@ -99,6 +99,20 @@ def notify_author_last_review(
99
99
)
100
100
101
101
102
+ def notify_assignees_successful_deletion (destruction_list : DestructionList ) -> None :
103
+ config = EmailConfig .get_solo ()
104
+ recipients = destruction_list .assignees .all ().values_list ("user__email" , flat = True )
105
+
106
+ notify (
107
+ subject = config .subject_successful_deletion ,
108
+ body = config .body_successful_deletion ,
109
+ context = {
110
+ "list" : destruction_list ,
111
+ },
112
+ recipients = list (recipients ),
113
+ )
114
+
115
+
102
116
class ObjectWithStatus (Protocol ):
103
117
def set_processing_status (self , status : InternalStatus ) -> None : ...
104
118
You can’t perform that action at this time.
0 commit comments