Fixed redirect signup error. Fixed login next url error

This commit is contained in:
Levi 2016-10-14 00:11:05 -05:00
parent eaf1f1de86
commit 05a165095d
2 changed files with 5 additions and 2 deletions

View file

@ -49,7 +49,7 @@
<br>
<div class="notice-box">
<p class="signup-text">Forgot password?<a href="{% url 'digitalglarus:reset_password' %}">Find ID/Password</a></p>
<p class="signup-text">Not a member yet?<a href="{% url 'digitalglarus:signup' %}">Sign up </a>now.</p>
<p class="signup-text">Not a member yet?<a href="{% url 'digitalglarus:signup' %}?{{request.GET.next}}">Sign up </a>now.</p>
</div>
</div>
</div>

View file

@ -17,7 +17,10 @@ class SignupViewMixin(CreateView):
success_url = None
def get_success_url(self):
next_url = self.request.POST.get('next', self.success_url)
next_url = self.request.POST.get('next') if self.request.POST.get('next')\
else self.success_url
return next_url
def form_valid(self, form):