Avoid deprecated User.email_address
property
This commit is contained in:
parent
9f65de2ba6
commit
625982d639
|
@ -90,7 +90,7 @@
|
|||
${parent.modify_this_page_vars()}
|
||||
<script type="text/javascript">
|
||||
|
||||
ThisPageData.testRecipient = ${json.dumps(request.user.email_address)|n}
|
||||
ThisPageData.testRecipient = ${json.dumps(user_email_address)|n}
|
||||
ThisPageData.sendingTest = false
|
||||
|
||||
ThisPage.methods.sendTest = function() {
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
return {
|
||||
previewFormButtonText: "Send Preview Email",
|
||||
previewFormSubmitting: false,
|
||||
userEmailAddress: ${json.dumps(request.user.email_address)|n},
|
||||
userEmailAddress: ${json.dumps(user_email_address)|n},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
@ -268,8 +268,14 @@ class EmailSettingView(MasterView):
|
|||
return data
|
||||
|
||||
def template_kwargs_view(self, **kwargs):
|
||||
kwargs = super().template_kwargs_view(**kwargs)
|
||||
app = self.get_rattail_app()
|
||||
|
||||
key = self.request.matchdict['key']
|
||||
kwargs['email'] = self.email_handler.get_email(key)
|
||||
|
||||
kwargs['user_email_address'] = app.get_contact_email_address(self.request.user)
|
||||
|
||||
return kwargs
|
||||
|
||||
def configure_get_simple_settings(self):
|
||||
|
@ -293,12 +299,15 @@ class EmailSettingView(MasterView):
|
|||
|
||||
def configure_get_context(self, *args, **kwargs):
|
||||
context = super().configure_get_context(*args, **kwargs)
|
||||
app = self.get_rattail_app()
|
||||
|
||||
# prettify list of template paths
|
||||
templates = self.rattail_config.parse_list(
|
||||
context['simple_settings']['rattail.mail.templates'])
|
||||
context['simple_settings']['rattail.mail.templates'] = ', '.join(templates)
|
||||
|
||||
context['user_email_address'] = app.get_contact_email_address(self.request.user)
|
||||
|
||||
return context
|
||||
|
||||
def toggle_hidden(self):
|
||||
|
|
Loading…
Reference in a new issue