From 362f12d8c91bb3848bd3c0c902081a4acd8551a9 Mon Sep 17 00:00:00 2001 From: Damien Date: Tue, 18 Sep 2018 16:36:11 +0200 Subject: [PATCH] [merge] keep original AN step extras when merging --- tlfp/merge.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tlfp/merge.py b/tlfp/merge.py index 1428dc7..d4644d7 100644 --- a/tlfp/merge.py +++ b/tlfp/merge.py @@ -83,13 +83,12 @@ def same_stage_step_instit(a, b): # get data from AN even if there's data on the senat side if same_stage_step_instit(an_step, step): - # only take source_url from the AN, we've got better infos for now - # from the senat - common_step = copy.deepcopy(step) - if an_step.get('source_url'): - common_step['source_url'] = an_step.get('source_url') - if 'date' not in common_step: - common_step['date'] = an_step.get('date') + # complete AN data with Senate data + common_step = copy.deepcopy(an_step) + if not an_step.get('date') and step.get('date'): + common_step['date'] = step['date'] + if not an_step.get('source_url') and step.get('source_url'): + common_step['source_url'] = step['source_url'] steps_to_add.append(common_step) """