Added 'site' parameter to PasswordResetViewMixin so that we can differentiate from which site we have requested a password reset.

This commit is contained in:
M.Ravi 2017-06-12 20:42:17 +05:30
parent 2f0b38302a
commit d84496b0de
2 changed files with 4 additions and 0 deletions

View file

@ -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')

View file

@ -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 <support@datacenterlight.ch>'
email = BaseEmail(**email_data)
email.send()