Эх сурвалжийг харах

after initial setup redir to vyos instance creation #15

Roberto Berto 5 жил өмнө
parent
commit
6b720c9692

+ 2 - 2
vycenter/accounts/views.py

@@ -5,6 +5,7 @@ from django.shortcuts import redirect
 from django.contrib.auth import authenticate
 from django.views.generic.base import TemplateView
 from django.conf import settings
+from django.urls import reverse
 
 
 from django.contrib.auth.models import User
@@ -29,8 +30,7 @@ def index(request):
         if 'username' in request.POST and 'password' in request.POST:
             user = User.objects.create_superuser(username=request.POST['username'], password=request.POST['password'])
             user.save()
-            return redirect('registration-login')
-         
+            return redirect('%s?next=%s' % (reverse('registration-login'), '/config/instance-add'))
     template = loader.get_template('registration/start.html')
     context = { 
         'users_admin': users_admin.all()