Add support for sign up redirection
This commit is contained in:
parent
88731d6371
commit
15259e59f2
2 changed files with 3 additions and 1 deletions
|
@ -38,6 +38,8 @@
|
||||||
{% trans "Login"%}
|
{% trans "Login"%}
|
||||||
</button>
|
</button>
|
||||||
{% endbuttons %}
|
{% endbuttons %}
|
||||||
|
|
||||||
|
<input type='hidden' name='next' value='{{request.GET.next}}'/>
|
||||||
</form>
|
</form>
|
||||||
<span>{% trans "Don't have an account yet ? "%}<a class="unlink" href="{% url 'hosting:signup' %}">{% trans "Sign up"%}</a></span>
|
<span>{% trans "Don't have an account yet ? "%}<a class="unlink" href="{% url 'hosting:signup' %}">{% trans "Sign up"%}</a></span>
|
||||||
<br/>
|
<br/>
|
||||||
|
|
|
@ -39,7 +39,7 @@ class LoginViewMixin(FormView):
|
||||||
success_url = None
|
success_url = None
|
||||||
|
|
||||||
def get_success_url(self):
|
def get_success_url(self):
|
||||||
next_url = self.request.session.get('next', self.success_url)
|
next_url = self.request.POST.get('next', self.success_url)
|
||||||
return next_url
|
return next_url
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
|
|
Loading…
Reference in a new issue