cubicweb/server/sources/native.py
branch3.25
changeset 12149 649100470733
parent 12148 79160d54662e
child 12152 f34d18d0603f
equal deleted inserted replaced
12148:79160d54662e 12149:649100470733
    39 
    39 
    40 from yams.schema import role_name
    40 from yams.schema import role_name
    41 
    41 
    42 from cubicweb import (UnknownEid, AuthenticationError, ValidationError, Binary,
    42 from cubicweb import (UnknownEid, AuthenticationError, ValidationError, Binary,
    43                       UniqueTogetherError, UndoTransactionException, ViolatedConstraint)
    43                       UniqueTogetherError, UndoTransactionException, ViolatedConstraint)
    44 from cubicweb import transaction as tx, server, neg_role
    44 from cubicweb import transaction as tx, server, neg_role, _
    45 from cubicweb.utils import QueryCache
    45 from cubicweb.utils import QueryCache
    46 from cubicweb.schema import VIRTUAL_RTYPES
    46 from cubicweb.schema import VIRTUAL_RTYPES
    47 from cubicweb.cwconfig import CubicWebNoAppConfiguration
    47 from cubicweb.cwconfig import CubicWebNoAppConfiguration
    48 from cubicweb.server import hook
    48 from cubicweb.server import hook
    49 from cubicweb.server import schema2sql as y2sql
    49 from cubicweb.server import schema2sql as y2sql
   350         self.create_eid = self.eid_generator.create_eid
   350         self.create_eid = self.eid_generator.create_eid
   351 
   351 
   352     def check_config(self, source_entity):
   352     def check_config(self, source_entity):
   353         """check configuration of source entity"""
   353         """check configuration of source entity"""
   354         if source_entity.host_config:
   354         if source_entity.host_config:
   355             msg = source_entity._cw._('the system source has its configuration '
   355             msg = _('the system source has its configuration '
   356                                       'stored on the file-system')
   356                     'stored on the file-system')
   357             raise ValidationError(source_entity.eid, {role_name('config', 'subject'): msg})
   357             raise ValidationError(source_entity.eid, {role_name('config', 'subject'): msg})
   358 
   358 
   359     def add_authentifier(self, authentifier):
   359     def add_authentifier(self, authentifier):
   360         self.authentifiers.append(authentifier)
   360         self.authentifiers.append(authentifier)
   361         authentifier.source = self
   361         authentifier.source = self