Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
protokollsystem
proto3
Commits
0320e65b
Commit
0320e65b
authored
Mar 16, 2018
by
Robin Sonnabend
Browse files
Fix redirect loop in back.py
parent
f4f5771f
Changes
1
Hide whitespace changes
Inline
Side-by-side
back.py
View file @
0320e65b
...
@@ -19,9 +19,17 @@ def anchor(func, cookie=cookie):
...
@@ -19,9 +19,17 @@ def anchor(func, cookie=cookie):
return
result
return
result
def
default_url
(
default
,
**
url_args
):
return
url_for
(
default
,
**
url_args
)
def
url
(
default
=
default_view
,
cookie
=
cookie
,
**
url_args
):
def
url
(
default
=
default_view
,
cookie
=
cookie
,
**
url_args
):
return
session
.
get
(
cookie
,
url_for
(
default
,
**
url_args
))
return
session
.
get
(
cookie
,
default_url
(
default
,
**
url_args
))
def
redirect
(
default
=
default_view
,
cookie
=
cookie
,
**
url_args
):
def
redirect
(
default
=
default_view
,
cookie
=
cookie
,
**
url_args
):
return
flask_redirect
(
url
(
default
,
cookie
,
**
url_args
))
print
(
request
.
url
,
request
.
url_rule
,
default
,
session
.
get
(
cookie
))
target
=
url
(
default
,
cookie
,
**
url_args
)
if
target
==
request
.
url
:
target
=
default_url
(
default
,
**
url_args
)
return
flask_redirect
(
target
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment