Added 'site' parameter to PasswordResetViewMixin so that we can differentiate from which site we have requested a password reset.
This commit is contained in:
		
					parent
					
						
							
								2f0b38302a
							
						
					
				
			
			
				commit
				
					
						d84496b0de
					
				
			
		
					 2 changed files with 4 additions and 0 deletions
				
			
		|  | @ -208,6 +208,7 @@ class SignupView(CreateView): | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class PasswordResetView(PasswordResetViewMixin): | class PasswordResetView(PasswordResetViewMixin): | ||||||
|  |     site='dcl' | ||||||
|     template_name = 'hosting/reset_password.html' |     template_name = 'hosting/reset_password.html' | ||||||
|     form_class = PasswordResetRequestForm |     form_class = PasswordResetRequestForm | ||||||
|     success_url = reverse_lazy('hosting:login') |     success_url = reverse_lazy('hosting:login') | ||||||
|  |  | ||||||
|  | @ -66,6 +66,7 @@ class PasswordResetViewMixin(FormView): | ||||||
|     # template_name = 'hosting/reset_password.html' |     # template_name = 'hosting/reset_password.html' | ||||||
|     # form_class = PasswordResetRequestForm |     # form_class = PasswordResetRequestForm | ||||||
|     success_message = "The link to reset your email has been sent to your email" |     success_message = "The link to reset your email has been sent to your email" | ||||||
|  |     site = '' | ||||||
|     # success_url = reverse_lazy('hosting:login') |     # success_url = reverse_lazy('hosting:login') | ||||||
| 
 | 
 | ||||||
|     def test_generate_email_context(self, user): |     def test_generate_email_context(self, user): | ||||||
|  | @ -94,6 +95,8 @@ class PasswordResetViewMixin(FormView): | ||||||
|             'template_name': 'password_reset_email', |             'template_name': 'password_reset_email', | ||||||
|             'template_path': self.template_email_path |             '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 = BaseEmail(**email_data) | ||||||
|         email.send() |         email.send() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue