From d84496b0debbbf6b23764a519459c9698f9f3293 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 12 Jun 2017 20:42:17 +0530 Subject: [PATCH] Added 'site' parameter to PasswordResetViewMixin so that we can differentiate from which site we have requested a password reset. --- hosting/views.py | 1 + utils/views.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/hosting/views.py b/hosting/views.py index 7e15ac2a..cc8f9005 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -208,6 +208,7 @@ class SignupView(CreateView): class PasswordResetView(PasswordResetViewMixin): + site='dcl' template_name = 'hosting/reset_password.html' form_class = PasswordResetRequestForm success_url = reverse_lazy('hosting:login') diff --git a/utils/views.py b/utils/views.py index b547506f..44a0322c 100644 --- a/utils/views.py +++ b/utils/views.py @@ -66,6 +66,7 @@ class PasswordResetViewMixin(FormView): # template_name = 'hosting/reset_password.html' # form_class = PasswordResetRequestForm success_message = "The link to reset your email has been sent to your email" + site = '' # success_url = reverse_lazy('hosting:login') def test_generate_email_context(self, user): @@ -94,6 +95,8 @@ class PasswordResetViewMixin(FormView): 'template_name': 'password_reset_email', 'template_path': self.template_email_path } + if self.site == 'dcl': + email_data['from_address'] = '(datacenterlight) datacenterlight Support ' email = BaseEmail(**email_data) email.send()