Skip to content

Commit

Permalink
Merge pull request #286 from Augustin-FL/fix-multi-bl-alerting
Browse files Browse the repository at this point in the history
fir_alerting: recipients should match what the user requested
  • Loading branch information
certsocietegenerale authored Aug 30, 2022
2 parents fd879d4 + 0b020b8 commit 61a41af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fir_alerting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ def get_template(request, incident_id, template_type, bl=None, authorization_tar
if not bl:
q_bl = Q(business_line__in=i.concerned_business_lines.all())
bl_name = i.get_business_lines_names()
parents = list(set(i.concerned_business_lines.all()))
else:
bl = get_object_or_404(BusinessLine, pk=bl)
q_bl = Q(business_line=bl)
bl_name = bl.name
parents = [bl]

rec_template = get_rec_template(q_bl & Q(type=template_type))

parents = list(set(i.concerned_business_lines.all()))

while not rec_template and len(parents):
parents = list(set([b.get_parent() for b in parents if not b.is_root()]))
q_parents = Q(business_line__in=parents)
Expand Down

0 comments on commit 61a41af

Please sign in to comment.