From 1407dcb4aa277fca4dffe4e42422aad8705323ba Mon Sep 17 00:00:00 2001 From: Thomas André Date: Mon, 21 Jul 2025 17:46:48 +0200 Subject: Correction of a bug if a Site is not linked with an Operation --- ishtar_common/qfield_functions.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ishtar_common/qfield_functions.py b/ishtar_common/qfield_functions.py index 36ab5c541..80c535999 100644 --- a/ishtar_common/qfield_functions.py +++ b/ishtar_common/qfield_functions.py @@ -696,11 +696,14 @@ def populating_layer_sites_query(layer, table_cols, col_names, datas): # Completion of the list of Context_Records linked to the extracted Sites list_cr = [] for name in list_ope: - ope, __ = Operation.objects.get_or_create(code_patriarche=name) - search = ContextRecord.objects.filter(operation=ope) - for cr in search: - if cr.label not in list_cr: - list_cr.append(cr.label) + try: + ope, __ = Operation.objects.get_or_create(code_patriarche=name) + search = ContextRecord.objects.filter(operation=ope) + for cr in search: + if cr.label not in list_cr: + list_cr.append(cr.label) + except: + pass return list_ope, list_cr -- cgit v1.2.3