Fix redirect url
Take user to virtual_machines page if the user ordered a VM
This commit is contained in:
		
					parent
					
						
							
								7cd485bc6d
							
						
					
				
			
			
				commit
				
					
						8deed169ca
					
				
			
		
					 1 changed files with 9 additions and 5 deletions
				
			
		| 
						 | 
					@ -1027,6 +1027,14 @@ class OrderConfirmationView(DetailView, FormView):
 | 
				
			||||||
                    latest_invoice.payment_intent
 | 
					                    latest_invoice.payment_intent
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                # TODO: requires_attention is probably wrong value to compare
 | 
					                # TODO: requires_attention is probably wrong value to compare
 | 
				
			||||||
 | 
					                if request.user.is_authenticated():
 | 
				
			||||||
 | 
					                    if 'generic_payment_details' in request.session:
 | 
				
			||||||
 | 
					                        redirect_url = reverse('hosting:invoices')
 | 
				
			||||||
 | 
					                    else:
 | 
				
			||||||
 | 
					                        redirect_url = reverse('hosting:virtual_machines')
 | 
				
			||||||
 | 
					                else:
 | 
				
			||||||
 | 
					                    redirect_url = reverse('datacenterlight:index')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (pi.status == 'requires_attention' or
 | 
					                if (pi.status == 'requires_attention' or
 | 
				
			||||||
                        pi.status == 'requires_source_action'):
 | 
					                        pi.status == 'requires_source_action'):
 | 
				
			||||||
                    logger.debug("Display SCA authentication %s " % pi.status)
 | 
					                    logger.debug("Display SCA authentication %s " % pi.status)
 | 
				
			||||||
| 
						 | 
					@ -1037,11 +1045,7 @@ class OrderConfirmationView(DetailView, FormView):
 | 
				
			||||||
                        'showSCA': True,
 | 
					                        'showSCA': True,
 | 
				
			||||||
                        'success': {
 | 
					                        'success': {
 | 
				
			||||||
                            'status': True,
 | 
					                            'status': True,
 | 
				
			||||||
                            'redirect': (
 | 
					                            'redirect': redirect_url,
 | 
				
			||||||
                                reverse('hosting:invoices')
 | 
					 | 
				
			||||||
                                if request.user.is_authenticated()
 | 
					 | 
				
			||||||
                                else reverse('datacenterlight:index')
 | 
					 | 
				
			||||||
                            ),
 | 
					 | 
				
			||||||
                            'msg_title': str(_('Thank you for the order.')),
 | 
					                            'msg_title': str(_('Thank you for the order.')),
 | 
				
			||||||
                            'msg_body': str(
 | 
					                            'msg_body': str(
 | 
				
			||||||
                                _('Your product will be provisioned as soon as'
 | 
					                                _('Your product will be provisioned as soon as'
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue