Commit 4dd19eca authored by Emmanuel Raviart's avatar Emmanuel Raviart

Don't erase other amendments when asking for only some of them.

parent 4e04f03f
......@@ -66,9 +66,10 @@ def add_task(context, **kwargs):
tasks.append(kwargs)
def get_amendements(context, bibard = None, bibard_suffixe = None, numeros = None):
def get_amendements(context, bibard = None, bibard_suffixe = None, full = False, numeros = None):
organe = context['organe']
log.info('get_amendements(bibard={}, bibard_suffixe={}, organe={})'.format(bibard, bibard_suffixe, organe))
log.info('get_amendements(bibard={}, bibard_suffixe={}, organe={}, full={})'.format(
bibard, bibard_suffixe, organe, full))
assert bibard
assert bibard_suffixe is not None
bibard_suffixed = bibard + bibard_suffixe
......@@ -107,10 +108,11 @@ def get_amendements(context, bibard = None, bibard_suffixe = None, numeros = Non
context['sort_by_numero_by_bibard_suffixed'][bibard_suffixed][numero] = amendement['sortEnSeance']
for json_filename in existing_filenames:
json_file_path = os.path.join(json_dir, json_filename)
log.info(' Removing obsolete amendment: {}'.format(json_file_path))
os.remove(json_file_path)
if full:
for json_filename in existing_filenames:
json_file_path = os.path.join(json_dir, json_filename)
log.info(' Removing obsolete amendment: {}'.format(json_file_path))
os.remove(json_file_path)
def get_discussion(context, bibard = None, bibard_suffixe = None):
......@@ -147,6 +149,7 @@ def get_discussion(context, bibard = None, bibard_suffixe = None):
function=get_amendements,
bibard=bibard,
bibard_suffixe=bibard_suffixe,
full=True,
numeros=numeros,
)
......@@ -197,6 +200,7 @@ def get_prochain_a_discuter(context):
function=get_amendements,
bibard=data['bibard'],
bibard_suffixe=data['bibardSuffixe'],
full=False,
numeros=numeros_without_sort + numeros[index:index + 2],
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment