diff --git a/tailbone/views/datasync.py b/tailbone/views/datasync.py index 876ac08d..3739483e 100644 --- a/tailbone/views/datasync.py +++ b/tailbone/views/datasync.py @@ -38,7 +38,7 @@ from tailbone.views import MasterView log = logging.getLogger(__name__) -class DataSyncChangeView(MasterView): +class DataSyncChangesView(MasterView): """ Master view for the DataSyncChange model. """ @@ -77,15 +77,20 @@ class DataSyncChangeView(MasterView): self.request.session.flash("DataSync daemon could not be restarted; result was: {}".format(result), 'error') return self.redirect(self.request.route_url('datasyncchanges')) + @classmethod + def defaults(cls, config): + + # fix permission group title + config.add_tailbone_permission_group('datasync', label="DataSync") + + # restart daemon + config.add_route('datasync.restart', '/datasync/restart') + config.add_view(cls, attr='restart', route_name='datasync.restart', + permission='datasync.restart') + config.add_tailbone_permission('datasync', 'datasync.restart', label="Restart DataSync Daemon") + + cls._defaults(config) + def includeme(config): - - config.add_tailbone_permission_group('datasync', label="DataSync") - - # restart daemon - config.add_route('datasync.restart', '/datasync/restart') - config.add_view(DataSyncChangeView, attr='restart', route_name='datasync.restart', - permission='datasync.restart') - config.add_tailbone_permission('datasync', 'datasync.restart', label="Restart DataSync Daemon") - - DataSyncChangeView.defaults(config) + DataSyncChangesView.defaults(config)