rattail-demo/rattail_demo/web/views/settings.py
Lance Edgar d812e5465a Add overrides for email profiles, settings views
to make feedback email config readonly
2016-12-10 14:55:36 -06:00

28 lines
600 B
Python

# -*- 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)