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
b1c97df9
Commit
b1c97df9
authored
Feb 17, 2018
by
Julian Rother
Browse files
Remove unnecessary redirects that may lead to redirect loops
/close
#119
parent
8266217c
Changes
1
Hide whitespace changes
Inline
Side-by-side
server.py
View file @
b1c97df9
...
...
@@ -506,7 +506,9 @@ def show_protocol(protocol):
user
=
current_user
()
errors_table
=
ErrorsTable
(
protocol
.
errors
)
if
not
protocol
.
protocoltype
.
has_public_view_right
(
user
,
check_networks
=
False
):
flash
(
"Die fehlen die nötigen Zugriffsrechte."
,
"alert-error"
)
flash
(
"Dir fehlen die nötigen Zugriffsrechte."
,
"alert-error"
)
if
check_login
():
return
redirect
(
url_for
(
"index"
))
return
redirect
(
request
.
args
.
get
(
"next"
)
or
url_for
(
"login"
,
next
=
request
.
url
))
visible_documents
=
[
document
for
document
in
protocol
.
documents
...
...
@@ -1336,7 +1338,7 @@ def new_like():
def
login
():
if
"auth"
in
session
and
current_user
()
is
not
None
:
flash
(
"You are already logged in."
,
"alert-success"
)
return
redirect
(
request
.
args
.
get
(
"next"
)
or
url_for
(
"index"
))
return
redirect
(
url_for
(
"index"
))
form
=
LoginForm
()
if
form
.
validate_on_submit
():
user
=
user_manager
.
login
(
form
.
username
.
data
,
form
.
password
.
data
,
permanent
=
form
.
permanent
.
data
)
...
...
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