summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas André <thomas.andre@iggdrasil.net>2025-07-21 17:46:48 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2025-07-29 08:49:03 +0200
commit1407dcb4aa277fca4dffe4e42422aad8705323ba (patch)
treebe4be59e7c844257906d0a3039684cc71a0a4592
parent0fc1189ccd8f95c6f201e7fbdc86f8345591dc0f (diff)
downloadIshtar-develop-5.0-stage.tar.bz2
Ishtar-develop-5.0-stage.zip
Correction of a bug if a Site is not linked with an Operationdevelop-5.0-stage
-rw-r--r--ishtar_common/qfield_functions.py13
1 files 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