rattail-demo/rattail_demo/web/views/email.py
2019-04-02 21:47:10 -05:00

33 lines
690 B
Python

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