diff --git a/MetaAnalytic.py b/MetaAnalytic.py index 1082c9a9078dc789d8e103009c3e4e62923a2e0e_TWV0YUFuYWx5dGljLnB5..7678a4134080cbd7d19ca3f012432ddc647b71be_TWV0YUFuYWx5dGljLnB5 100644 --- a/MetaAnalytic.py +++ b/MetaAnalytic.py @@ -455,7 +455,7 @@ if sync_parent: cp = self._get_code_parent(vals) - if cp is not None: + if cp is not None and cp: code_vals['code_parent_id'] = cp.id # Direct changes to the 'bound analytic code' field are ignored @@ -480,7 +480,7 @@ if sync_parent: cp = self._get_code_parent(vals) - if cp is not None: + if cp is not None and cp: code_vals['code_parent_id'] = cp.id new_code, vals = self._create_analytic_code( @@ -521,9 +521,9 @@ if sync_parent: cp = self._get_code_parent(vals) - if cp is not None: + if cp is not None and cp: code_vals['code_parent_id'] = cp.id else: parent = getattr(self, sync_parent) if parent: cp = getattr(parent, parent_column) @@ -525,9 +525,9 @@ code_vals['code_parent_id'] = cp.id else: parent = getattr(self, sync_parent) if parent: cp = getattr(parent, parent_column) - if cp: + if cp is not None and cp: code_vals['code_parent_id'] = cp.id # Direct changes to the 'bound analytic code' field are ignored