File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,7 +135,12 @@ def get_notify(self):
135135 old_msg = "" .join (old_msg .split ())
136136 new_msg = self .cleaned_data ['response_msg' ] or ''
137137 new_msg = "" .join (new_msg .split ())
138- return Feedback .NOTIFY .NORMAL if old_msg != new_msg else Feedback .NOTIFY .NO
138+ if new_msg == '' : # empty message always removes notification
139+ return Feedback .NOTIFY .REMOVE
140+ elif old_msg == '' and new_msg != '' : # empty to non-empty sends notification
141+ return Feedback .NOTIFY .NORMAL
142+ else :
143+ return Feedback .NOTIFY .NO # editing non-empty message does not change notification status
139144 # FIXME: add support for instance.NOTIFY.IMPORTANT
140145
141146 def save (self ): # pylint: disable=arguments-differ
Original file line number Diff line number Diff line change @@ -407,8 +407,10 @@ class Meta:
407407 ('NO' , 0 , _ ('No notification' )),
408408 ('NORMAL' , 1 , _ ('Normal notification' )),
409409 ('IMPORTANT' , 2 , _ ('Important notification' )),
410+ ('REMOVE' , 10 , _ ('Remove notification' )),
410411 )
411412 NOTIFY_APLUS = {
413+ NOTIFY .REMOVE : 'remove' ,
412414 NOTIFY .NORMAL : 'normal' ,
413415 NOTIFY .IMPORTANT : 'important' ,
414416 }
You can’t perform that action at this time.
0 commit comments