File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,7 +54,9 @@ def create_observation_log( # pylint: disable=too-many-arguments
5454 Assessment_Status .ASSESSMENT_STATUS_REMOVED
5555 ):
5656 send_observation_notification (observation )
57- send_observation_title_notification (observation )
57+ send_observation_title_notification (
58+ observation , Observation_Log .objects .filter (observation = observation ).count () == 1
59+ )
5860
5961 return observation_log
6062
Original file line number Diff line number Diff line change 1+ from typing import Optional
2+
13from application .access_control .services .current_user import get_current_user
24from application .commons .models import Settings
35from application .commons .services .functions import get_base_url_frontend
1517)
1618
1719
18- def send_observation_title_notification (observation : Observation ) -> None :
20+ def send_observation_title_notification (observation : Observation , observation_new : Optional [ bool ] = False ) -> None :
1921 settings = Settings .load ()
2022
2123 observation_title_notification_min_severity = settings .observation_title_notification_min_severity
@@ -89,7 +91,7 @@ def send_observation_title_notification(observation: Observation) -> None:
8991 observation_title_notified .status = observation .current_status
9092 observation_title_notified .priority = observation .current_priority
9193 observation_title_notified .save ()
92- else :
94+ elif not observation_new :
9395 try :
9496 observation_title_notified = Observation_Title_Notified .objects .get (title = observation .title )
9597 except Observation_Title_Notified .DoesNotExist :
You can’t perform that action at this time.
0 commit comments