diff --git a/rattail_demo/web/views/__init__.py b/rattail_demo/web/views/__init__.py index 66a2b7e..951d5df 100644 --- a/rattail_demo/web/views/__init__.py +++ b/rattail_demo/web/views/__init__.py @@ -17,7 +17,7 @@ def includeme(config): config.include('tailbone_corepos.views.customers') config.include('tailbone.views.datasync') config.include('rattail_demo.web.views.departments') - config.include('rattail_demo.web.views.email') + config.include('tailbone.views.email') config.include('rattail_demo.web.views.employees') config.include('tailbone.views.families') config.include('tailbone_corepos.views.members') @@ -26,7 +26,7 @@ def includeme(config): config.include('rattail_demo.web.views.products') config.include('tailbone.views.reportcodes') config.include('tailbone.views.roles') - config.include('rattail_demo.web.views.settings') + config.include('tailbone.views.settings') config.include('tailbone.views.stores') config.include('tailbone_corepos.views.subdepartments') config.include('tailbone.views.tempmon') diff --git a/rattail_demo/web/views/email.py b/rattail_demo/web/views/email.py deleted file mode 100644 index 03d9a5b..0000000 --- a/rattail_demo/web/views/email.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8; -*- -""" -Email views -""" - -from __future__ import unicode_literals, absolute_import - -from tailbone.views import email as base - - -class ProfilesView(base.ProfilesView): - """ - Prevent edit/delete for 'feedback' email config - """ - - protected = [ - 'user_feedback', - 'upgrade_success', - 'upgrade_failure', - ] - - def editable_instance(self, profile): - return profile['key'] not in self.protected - - def deletable_instance(self, profile): - return profile['key'] not in self.protected - - -def includeme(config): - ProfilesView.defaults(config) - base.EmailPreview.defaults(config) - base.EmailAttemptView.defaults(config) diff --git a/rattail_demo/web/views/settings.py b/rattail_demo/web/views/settings.py deleted file mode 100644 index b7082a9..0000000 --- a/rattail_demo/web/views/settings.py +++ /dev/null @@ -1,38 +0,0 @@ -# -*- coding: utf-8; -*- -""" -Settings views -""" - -from __future__ import unicode_literals, absolute_import - -import re - -from tailbone.views import settings as base - - -class SettingsView(base.SettingsView): - """ - Prevent edit/delete for 'feedback' email settings - """ - protected = [ - re.compile(r'^rattail\.mail\.user_feedback\..*'), - re.compile(r'^rattail\.mail\.upgrade_success\..*'), - re.compile(r'^rattail\.mail\.upgrade_failure\..*'), - ] - - def editable_instance(self, setting): - for pattern in self.protected: - if pattern.match(setting.name): - return False - return True - - def deletable_instance(self, setting): - for pattern in self.protected: - if pattern.match(setting.name): - return False - return True - - -def includeme(config): - base.AppSettingsView.defaults(config) - SettingsView.defaults(config)