Redirect user to product page on login
For the case when user is on product page and tries logging in
This commit is contained in:
		
					parent
					
						
							
								e3ec67d32c
							
						
					
				
			
			
				commit
				
					
						12eabc5f6c
					
				
			
		
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -346,6 +346,13 @@ class PaymentOrderView(FormView): | |||
|                 auth_user = authenticate(email=email, password=password) | ||||
|                 if auth_user: | ||||
|                     login(self.request, auth_user) | ||||
|                     if 'product_slug' in kwargs: | ||||
|                         return HttpResponseRedirect( | ||||
|                             reverse('show_product', | ||||
|                                     kwargs={ | ||||
|                                         'product_slug': kwargs['product_slug']} | ||||
|                                     ) | ||||
|                         ) | ||||
|                     return HttpResponseRedirect( | ||||
|                         reverse('datacenterlight:payment') | ||||
|                     ) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue