From 3a538e45bf9abe997043a702fa5b2df6c162d33c Mon Sep 17 00:00:00 2001 From: heinzel Date: Thu, 7 Jan 2021 13:40:55 +0100 Subject: [PATCH] FIX #e585f6057b --- dav_events/workflow.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dav_events/workflow.py b/dav_events/workflow.py index c173c41..f1c012b 100644 --- a/dav_events/workflow.py +++ b/dav_events/workflow.py @@ -268,14 +268,16 @@ class BasicWorkflow(object): if heaviest_flag: last_status = heaviest_flag.status if last_status.code.startswith('publishing_'): - flags = event.flags.filter(status__code='accepted') - flags.append(heaviest_flag) + flags = [] + flags += event.flags.filter(status__code='accepted') + flags += heaviest_flag elif last_status.code.startswith('published_'): + flags = [] if event.flags.filter(status__code='publishing').exists(): - flags = event.flags.filter(status__code='publishing') + flags += event.flags.filter(status__code='publishing') else: - flags = event.flags.filter(status__code='accepted') - flags.append(heaviest_flag) + flags += event.flags.filter(status__code='accepted') + flags += heaviest_flag elif last_status.code.startswith('clear'): flags = [heaviest_flag] flags += event.flags.filter(status__code__in=('canceled', 'realized'))