From 3a538e45bf9abe997043a702fa5b2df6c162d33c Mon Sep 17 00:00:00 2001 From: heinzel Date: Thu, 7 Jan 2021 13:40:55 +0100 Subject: [PATCH 1/2] 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')) From 4890c2430f40156849a5174ba30bc9b3c73dac28 Mon Sep 17 00:00:00 2001 From: heinzel Date: Thu, 7 Jan 2021 13:48:31 +0100 Subject: [PATCH 2/2] FIX #3a538e45bf --- dav_events/workflow.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dav_events/workflow.py b/dav_events/workflow.py index f1c012b..36ddb06 100644 --- a/dav_events/workflow.py +++ b/dav_events/workflow.py @@ -266,23 +266,21 @@ class BasicWorkflow(object): heaviest_flag = event.flags.order_by('status').last() if heaviest_flag: + flags = [] last_status = heaviest_flag.status if last_status.code.startswith('publishing_'): - flags = [] flags += event.flags.filter(status__code='accepted') - flags += heaviest_flag + flags.append(heaviest_flag) elif last_status.code.startswith('published_'): - flags = [] if event.flags.filter(status__code='publishing').exists(): flags += event.flags.filter(status__code='publishing') else: flags += event.flags.filter(status__code='accepted') - flags += heaviest_flag + flags.append(heaviest_flag) elif last_status.code.startswith('clear'): - flags = [heaviest_flag] - flags += event.flags.filter(status__code__in=('canceled', 'realized')) + flags += event.flags.filter(status__code__in=('cleared', 'canceled', 'realized')) else: - flags = [heaviest_flag] + flags.append(heaviest_flag) deferred_publishing = event.planned_publication_date and event.planned_publication_date > today add_publishing_date = False