Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-cas
Overview
Overview
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-cas
Commits
9a891b51
Commit
9a891b51
authored
Jul 14, 2013
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make compatible with django 1.4 by updating messaging
parent
a4eec822
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
django_cas/views.py
+3
-2
No files found.
django_cas/views.py
View file @
9a891b51
...
...
@@ -5,6 +5,7 @@ from urlparse import urljoin
from
django.http
import
get_host
,
HttpResponseRedirect
,
HttpResponseForbidden
,
HttpResponse
from
django.conf
import
settings
from
django.contrib
import
messages
from
django.contrib.auth
import
REDIRECT_FIELD_NAME
from
django_cas.models
import
PgtIOU
...
...
@@ -74,7 +75,7 @@ def login(request, next_page=None, required=False):
next_page
=
_redirect_url
(
request
)
if
request
.
user
.
is_authenticated
():
message
=
"You are logged in as
%
s."
%
request
.
user
.
username
request
.
user
.
message_set
.
create
(
message
=
message
)
messages
.
success
(
request
,
message
)
return
HttpResponseRedirect
(
next_page
)
ticket
=
request
.
GET
.
get
(
'ticket'
)
service
=
_service_url
(
request
,
next_page
)
...
...
@@ -86,7 +87,7 @@ def login(request, next_page=None, required=False):
auth
.
login
(
request
,
user
)
name
=
user
.
first_name
or
user
.
username
message
=
"Login succeeded. Welcome,
%
s."
%
name
user
.
message_set
.
create
(
message
=
message
)
messages
.
success
(
request
,
message
)
return
HttpResponseRedirect
(
next_page
)
elif
settings
.
CAS_RETRY_LOGIN
or
required
:
return
HttpResponseRedirect
(
_login_url
(
service
,
ticket
))
...
...
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