workflow: remove aggregation email if can not send it (#19389)

This commit is contained in:
Thomas NOËL 2017-10-12 08:59:20 +02:00
parent a1966769a3
commit a909983795
1 changed files with 7 additions and 4 deletions

View File

@ -92,12 +92,15 @@ def send_aggregation_emails(publisher):
cache = {}
for aggregate_id in AggregationEmail.keys():
role = Role.get(aggregate_id)
if not role.emails:
continue
aggregate = AggregationEmail.get(aggregate_id)
aggregate.remove_self()
try:
role = Role.get(aggregate_id)
except KeyError:
continue
if not role.emails:
continue
if not aggregate.items:
continue