hooks/syncschema.py
branchstable
changeset 4624 1b46d5ece0d5
parent 4591 47acae3cb778
child 4667 6c8eccb1b695
equal deleted inserted replaced
4623:994c70fe5006 4624:1b46d5ece0d5
   688         """the observed connections pool has been commited"""
   688         """the observed connections pool has been commited"""
   689         try:
   689         try:
   690             erschema = self.session.vreg.schema.schema_by_eid(self.eid)
   690             erschema = self.session.vreg.schema.schema_by_eid(self.eid)
   691         except KeyError:
   691         except KeyError:
   692             # duh, schema not found, log error and skip operation
   692             # duh, schema not found, log error and skip operation
   693             self.error('no schema for %s', self.eid)
   693             self.warning('no schema for %s', self.eid)
   694             return
   694             return
   695         perms = list(erschema.action_permissions(self.action))
   695         perms = list(erschema.action_permissions(self.action))
   696         if hasattr(self, 'group_eid'):
   696         if hasattr(self, 'group_eid'):
   697             perm = self.session.entity_from_eid(self.group_eid).name
   697             perm = self.session.entity_from_eid(self.group_eid).name
   698         else:
   698         else:
   715         """the observed connections pool has been commited"""
   715         """the observed connections pool has been commited"""
   716         try:
   716         try:
   717             erschema = self.session.vreg.schema.schema_by_eid(self.eid)
   717             erschema = self.session.vreg.schema.schema_by_eid(self.eid)
   718         except KeyError:
   718         except KeyError:
   719             # duh, schema not found, log error and skip operation
   719             # duh, schema not found, log error and skip operation
   720             self.error('no schema for %s', self.eid)
   720             self.warning('no schema for %s', self.eid)
   721             return
   721             return
   722         if isinstance(erschema, RelationSchema): # XXX 3.6 migration
   722         if isinstance(erschema, RelationSchema): # XXX 3.6 migration
   723             return
   723             return
   724         if isinstance(erschema, RelationDefinitionSchema) and \
   724         if isinstance(erschema, RelationDefinitionSchema) and \
   725                self.action in ('delete', 'add'): # XXX 3.6.1 migration
   725                self.action in ('delete', 'add'): # XXX 3.6.1 migration