From d84496b0debbbf6b23764a519459c9698f9f3293 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 12 Jun 2017 20:42:17 +0530 Subject: [PATCH 1/3] 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() From a2a3cc1f5ab4eb9b788d4ee105ad131a0b6b1646 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Mon, 12 Jun 2017 20:51:48 +0530 Subject: [PATCH 2/3] Small code formatting --- hosting/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosting/views.py b/hosting/views.py index cc8f9005..03b19b8c 100644 --- a/hosting/views.py +++ b/hosting/views.py @@ -208,7 +208,7 @@ class SignupView(CreateView): class PasswordResetView(PasswordResetViewMixin): - site='dcl' + site = 'dcl' template_name = 'hosting/reset_password.html' form_class = PasswordResetRequestForm success_url = reverse_lazy('hosting:login') From d4876cdecb8a13930fd211d684427b4d759fac91 Mon Sep 17 00:00:00 2001 From: Pcoder Date: Fri, 16 Jun 2017 00:09:11 +0530 Subject: [PATCH 3/3] Fixed the username for the from_email address --- utils/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/views.py b/utils/views.py index 6ae36f9e..039e08d8 100644 --- a/utils/views.py +++ b/utils/views.py @@ -97,7 +97,7 @@ class PasswordResetViewMixin(FormView): 'template_path': self.template_email_path } if self.site == 'dcl': - email_data['from_address'] = '(datacenterlight) datacenterlight Support ' + email_data['from_address'] = '(Data Center Light) Data Center Light Support ' email = BaseEmail(**email_data) email.send()