rattail-demo/rattail_demo/web/views/settings.py

28 lines
600 B
Python
Raw Normal View History

# -*- 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
"""
feedback = re.compile(r'^rattail\.mail\.user_feedback\..*')
def editable_instance(self, setting):
return not bool(self.feedback.match(setting.name))
def deletable_instance(self, setting):
return not bool(self.feedback.match(setting.name))
def includeme(config):
SettingsView.defaults(config)