cubicweb/hooks/syncsources.py
branch3.25
changeset 12153 0ff0aff4413d
parent 12152 f34d18d0603f
child 12156 0d1d22a3a48b
equal deleted inserted replaced
12152:f34d18d0603f 12153:0ff0aff4413d
    49         if self.entity.type not in SOURCE_TYPES:
    49         if self.entity.type not in SOURCE_TYPES:
    50             msg = _('Unknown source type')
    50             msg = _('Unknown source type')
    51             raise validation_error(self.entity, {('type', 'subject'): msg})
    51             raise validation_error(self.entity, {('type', 'subject'): msg})
    52 
    52 
    53         source = self.get_source(self.entity)
    53         source = self.get_source(self.entity)
       
    54         source.check_urls(self.entity)
    54         source.check_config(self.entity)
    55         source.check_config(self.entity)
    55 
    56 
    56 
    57 
    57 class SourceRemovedHook(SourceHook):
    58 class SourceRemovedHook(SourceHook):
    58     __regid__ = 'cw.sources.removed'
    59     __regid__ = 'cw.sources.removed'
    74             if oldname == 'system':
    75             if oldname == 'system':
    75                 msg = _("You cannot rename the system source")
    76                 msg = _("You cannot rename the system source")
    76                 raise validation_error(self.entity, {('name', 'subject'): msg})
    77                 raise validation_error(self.entity, {('name', 'subject'): msg})
    77 
    78 
    78         source = self.get_source(self.entity)
    79         source = self.get_source(self.entity)
       
    80         if 'url' in self.entity.cw_edited:
       
    81             source.check_urls(self.entity)
    79         if 'config' in self.entity.cw_edited:
    82         if 'config' in self.entity.cw_edited:
    80             source.check_config(self.entity)
    83             source.check_config(self.entity)