cubicweb/hooks/metadata.py
changeset 11773 054a947b5415
parent 11767 432f87a63057
child 11774 51c160677afe
equal deleted inserted replaced
11772:54fa73a2f931 11773:054a947b5415
   192                 raise Exception('changing source to something else than the '
   192                 raise Exception('changing source to something else than the '
   193                                 'system source is unsupported')
   193                                 'system source is unsupported')
   194             syssource = newsource.repo_source
   194             syssource = newsource.repo_source
   195             oldsource = self._cw.entity_from_eid(schange[self.eidfrom])
   195             oldsource = self._cw.entity_from_eid(schange[self.eidfrom])
   196             entity = self._cw.entity_from_eid(self.eidfrom)
   196             entity = self._cw.entity_from_eid(self.eidfrom)
   197             attrs = {'type': entity.cw_etype, 'eid': entity.eid, 'extid': None,
   197             attrs = {'type': entity.cw_etype, 'eid': entity.eid, 'extid': None}
   198                      'asource': 'system'}
       
   199             self._cw.system_sql(syssource.sqlgen.update('entities', attrs, ['eid']), attrs)
   198             self._cw.system_sql(syssource.sqlgen.update('entities', attrs, ['eid']), attrs)
   200             # register an operation to update repository/sources caches
   199             # register an operation to update repository/sources caches
   201             ChangeEntitySourceUpdateCaches(self._cw, entity=entity,
   200             ChangeEntitySourceUpdateCaches(self._cw, entity=entity,
   202                                            oldsource=oldsource.repo_source)
   201                                            oldsource=oldsource.repo_source)