Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
00e235c7
authored
Feb 11, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: log shib logins
parent
448ef865
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
school/views.py
+8
-4
No files found.
school/views.py
View file @
00e235c7
...
...
@@ -62,7 +62,8 @@ def login(request):
for
c
in
attended
:
try
:
co
=
Course
.
objects
.
get
(
code
=
c
)
except
:
except
Exception
as
e
:
logger
.
warning
(
"Django could not get Course
%
s:
%
s"
%
(
c
,
e
))
continue
g
=
co
.
get_or_create_default_group
()
if
p
.
course_groups
.
filter
(
semester
=
sem
,
course
=
co
)
.
count
()
==
0
:
...
...
@@ -70,7 +71,9 @@ def login(request):
g
.
members
.
add
(
p
)
g
.
save
()
messages
.
info
(
request
,
_
(
'Course "
%
s" added.'
)
%
g
.
course
)
logger
.
warning
(
'Django Course "
%
s" added.'
%
g
.
course
)
except
Exception
as
e
:
messages
.
error
(
request
,
_
(
'Failed to add course "
%
s".'
)
%
g
.
course
)
logger
.
warning
(
"Django ex
%
s"
%
e
)
except
ValidationError
as
e
:
logger
.
warning
(
"Django ex4
%
s"
%
e
)
...
...
@@ -83,13 +86,14 @@ def login(request):
for
c
in
held
:
co
,
created
=
Course
.
objects
.
get_or_create
(
code
=
c
)
if
created
:
logger
.
warning
(
"
d
jango Course
%
s created"
%
c
)
logger
.
warning
(
"
D
jango Course
%
s created"
%
c
)
g
=
co
.
get_or_create_default_group
()
try
:
co
.
owners
.
add
(
p
)
g
.
owners
.
add
(
p
)
messages
.
info
(
request
,
_
(
'Course "
%
s" ownership added.'
)
%
g
.
course
)
except
Exception
as
e
:
messages
.
error
(
request
,
_
(
'Failed to add course "
%
s" ownership.'
)
%
g
.
course
)
logger
.
warning
(
"Django ex
%
s"
%
e
)
co
.
save
()
g
.
save
()
...
...
@@ -107,9 +111,9 @@ def login(request):
g
=
Group
.
objects
.
filter
(
name
=
a
)
g
.
members
.
add
(
p
)
g
.
save
()
messages
.
info
(
request
,
_
(
'Course "
%
s" added.'
)
%
g
.
course
)
logger
.
warning
(
"Django affiliation
%
s added to
%
s"
%
(
a
,
p
)
)
except
:
pass
logger
.
warning
(
"Django FAIL affiliation
%
s added to
%
s"
%
(
a
,
p
))
user
.
save
()
p
.
save
()
...
...
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