Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
078350dc
Commit
078350dc
authored
Jan 26, 2016
by
Romain Loth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] login via auth: corrected a mistake in previous commit
parent
fd9b53a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
views.py
gargantext_web/views.py
+8
-6
No files found.
gargantext_web/views.py
View file @
078350dc
...
@@ -54,17 +54,19 @@ def login_user(request):
...
@@ -54,17 +54,19 @@ def login_user(request):
next_page
=
""
next_page
=
""
if
request
.
GET
:
if
request
.
method
==
"GET"
:
additional_context
=
{}
# if for exemple: auth/?next=/project/5/corpus/554/document/556/
# if for exemple: auth/?next=/project/5/corpus/554/document/556/
# => we'll forward ?next="..." into template with form
# => we'll forward ?next="..." into template with form
additional_context
=
{
'next_page'
:
request
.
GET
[
'next'
]}
if
(
'next'
in
request
.
GET
):
additional_context
=
{
'next_page'
:
request
.
GET
[
'next'
]}
return
render_to_response
(
'authentication.html'
,
return
render_to_response
(
'authentication.html'
,
additional_context
,
additional_context
,
context_instance
=
RequestContext
(
request
)
context_instance
=
RequestContext
(
request
)
)
)
elif
request
.
POST
:
elif
request
.
method
==
"POST"
:
username
=
request
.
POST
[
'username'
]
username
=
request
.
POST
[
'username'
]
# /!\ pass is sent clear in POST data
# /!\ pass is sent clear in POST data
...
@@ -77,12 +79,12 @@ def login_user(request):
...
@@ -77,12 +79,12 @@ def login_user(request):
login
(
request
,
user
)
login
(
request
,
user
)
# if "next" forwarded from the GET via the template form
# if "next" forwarded from the GET via the template form
next_page
=
request
.
POST
[
'the_next_page'
]
if
(
'the_next_page'
in
request
.
POST
):
if
next_page
:
return
HttpResponseRedirect
(
request
.
POST
[
'the_next_page'
])
return
HttpResponseRedirect
(
next_page
)
else
:
else
:
return
HttpResponseRedirect
(
'/projects/'
)
return
HttpResponseRedirect
(
'/projects/'
)
def
logout_user
(
request
):
def
logout_user
(
request
):
logout
(
request
)
logout
(
request
)
return
HttpResponseRedirect
(
'/'
)
return
HttpResponseRedirect
(
'/'
)
...
...
Write
Preview
Markdown
is supported
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