added next url to ssh create key view
This commit is contained in:
		
					parent
					
						
							
								646f73763e
							
						
					
				
			
			
				commit
				
					
						02a2ac31c6
					
				
			
		
					 2 changed files with 6 additions and 2 deletions
				
			
		|  | @ -113,6 +113,10 @@ | ||||||
| {%endif%} | {%endif%} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | {% if next_url %} | ||||||
|  |     window.location.href = '{{next_url}}' | ||||||
|  | {% endif %} | ||||||
|  | 
 | ||||||
| {%endblock%} | {%endblock%} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -287,7 +287,6 @@ class GenerateVMSSHKeysView(LoginRequiredMixin, FormView): | ||||||
|     form_class = UserHostingKeyForm |     form_class = UserHostingKeyForm | ||||||
|     model = UserHostingKey |     model = UserHostingKey | ||||||
|     template_name = 'hosting/virtual_machine_key.html' |     template_name = 'hosting/virtual_machine_key.html' | ||||||
|     success_url = reverse_lazy('hosting:orders') |  | ||||||
|     login_url = reverse_lazy('hosting:login') |     login_url = reverse_lazy('hosting:login') | ||||||
|     context_object_name = "virtual_machine" |     context_object_name = "virtual_machine" | ||||||
| 
 | 
 | ||||||
|  | @ -324,7 +323,8 @@ class GenerateVMSSHKeysView(LoginRequiredMixin, FormView): | ||||||
|             context.update({ |             context.update({ | ||||||
|                 'private_key': form.cleaned_data.get('private_key'), |                 'private_key': form.cleaned_data.get('private_key'), | ||||||
|                 'key_name': form.cleaned_data.get('name'), |                 'key_name': form.cleaned_data.get('name'), | ||||||
|                 'form': UserHostingKeyForm(request=self.request) |                 'form': UserHostingKeyForm(request=self.request), | ||||||
|  |                 'next_url': self.request.session.get('next', None) | ||||||
|             }) |             }) | ||||||
| 
 | 
 | ||||||
|         # return HttpResponseRedirect(reverse('hosting:key_pair')) |         # return HttpResponseRedirect(reverse('hosting:key_pair')) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue