d812e5465a
to make feedback email config readonly
28 lines
600 B
Python
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)
|