Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
fix redirect after login
Browse files Browse the repository at this point in the history
  • Loading branch information
monty5811 committed Nov 7, 2016
1 parent 566354b commit a9970af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.

### Fixed
- Fix rounding error on sending pages
- Redirect to correct page after login

## [v1.13.1]
### Fixed
Expand Down
5 changes: 4 additions & 1 deletion apostello/decorators.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from functools import partial, wraps
from urllib.parse import quote

from django.conf import settings
from django.contrib import messages
Expand Down Expand Up @@ -49,7 +50,9 @@ def f(*args, **kwargs):
# check for anon users:
# this hsould not be neccessary, but it works...
if not request.user.is_authenticated():
return redirect(settings.LOGIN_URL)
redirect_url = settings.LOGIN_URL + '?next=' + quote(
request.get_full_path())
return redirect(redirect_url)
# check approval status:
if not request.user.profile.approved:
return redirect(reverse('not_approved'))
Expand Down

0 comments on commit a9970af

Please sign in to comment.