From f1e6493674b29a7c9f13e40c3b12d5473853613a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 18 Jun 2019 13:12:40 +0200 Subject: Treatment: fix py3 keys() management --- archaeological_finds/models_treatments.py | 2 +- archaeological_finds/wizards.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 996e03370..120dfe6f2 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -343,7 +343,7 @@ class Treatment(DashboardFormItem, ValueGetter, DocumentItem, """ m2m = {} base_fields = [f.name for f in Find._meta.get_fields()] - for k in resulting_find.keys(): + for k in list(resulting_find.keys()): # if not in base fields should be a m2m if k not in base_fields: values = resulting_find.pop(k) diff --git a/archaeological_finds/wizards.py b/archaeological_finds/wizards.py index 675d28474..e1c6814d6 100644 --- a/archaeological_finds/wizards.py +++ b/archaeological_finds/wizards.py @@ -296,7 +296,7 @@ class TreatmentN1Wizard(TreatmentBase): initial = self._update_char_initial_from_finds( initial, find, k, sep='\n') - for k in initial.keys(): + for k in list(initial.keys()): if initial[k] is None: initial.pop(k) return initial @@ -329,7 +329,7 @@ class TreatmentN1Wizard(TreatmentBase): # extract data of the new find dct['resulting_find'] = {} - for k in dct.keys(): + for k in list(dct.keys()): if k.startswith('resulting_') and k != "resulting_find": dct['resulting_find'][ k[len('resulting_'):] -- cgit v1.2.3