equal
deleted
inserted
replaced
148 |
148 |
149 if not fields['home_link_id'] and entity.home: |
149 if not fields['home_link_id'] and entity.home: |
150 properties = {'home_for': None} |
150 properties = {'home_for': None} |
151 document_logic.logic.updateEntityProperties(entity.home, properties) |
151 document_logic.logic.updateEntityProperties(entity.home, properties) |
152 |
152 |
153 scope_path = self._logic.getKeyNameFromFields(fields) |
153 home_doc = fields.get('resolved_home_link_id') |
154 |
|
155 key_fields = { |
|
156 'scope_path': scope_path, |
|
157 'link_id': fields['home_link_id'], |
|
158 'prefix': self._params['document_prefix'], |
|
159 } |
|
160 |
|
161 # TODO notify the user if home_doc is not found |
|
162 home_doc = document_logic.logic.getFromKeyFields(key_fields) |
|
163 |
|
164 fields['home'] = home_doc |
154 fields['home'] = home_doc |
165 |
155 |
166 if home_doc: |
156 if home_doc: |
167 properties = {'home_for': entity} |
157 properties = {'home_for': entity} |
168 document_logic.logic.updateEntityProperties(home_doc, properties) |
158 document_logic.logic.updateEntityProperties(home_doc, properties) |