Properly redirect after login
authorMagnus Hagander <magnus@hagander.net>
Sat, 17 Dec 2011 14:01:40 +0000 (15:01 +0100)
committerMagnus Hagander <magnus@hagander.net>
Sat, 17 Dec 2011 14:03:12 +0000 (15:03 +0100)
Since the "next" field was missing, any login always redirected to the
default account page, even though it came with a "next" parameter that
would allow it to go to the correct place.

templates/account/login.html

index 0c815e1e7085a53b67c35016fb16e1df1bd25d26..3476ac7fb6c572e59741e3e3460d50f94ab7bdad 100644 (file)
@@ -14,6 +14,7 @@ password, you can use the <a href="/account/reset/">password reset</a> form.
   <div class="form-row">
     <label for="id_password">Password:</label> <input type="password" name="password" id="id_password" />
     <input type="hidden" name="this_is_the_login_form" value="1" />
+    <input type="hidden" name="next" value="{{next}}" />
   </div>
   <div class="submit-row">
     <label>&nbsp;</label><input type="submit" value="Log in" />