Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c930c36b
authored
Feb 03, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: handle empty attrs
refs #30
parent
d7119c30
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
school/views.py
+13
-2
No files found.
school/views.py
View file @
c930c36b
...
@@ -20,6 +20,7 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -20,6 +20,7 @@ from django.utils.translation import ugettext_lazy as _
from
django.views.decorators.http
import
*
from
django.views.decorators.http
import
*
from
django.views.generic
import
*
from
django.views.generic
import
*
from
one.models
import
*
from
one.models
import
*
from
school.models
import
*
import
django.contrib.auth
as
auth
import
django.contrib.auth
as
auth
import
logging
import
logging
...
@@ -47,7 +48,12 @@ def login(request):
...
@@ -47,7 +48,12 @@ def login(request):
try
:
try
:
sem
=
Semester
.
get_current
()
sem
=
Semester
.
get_current
()
for
c
in
request
.
META
[
'HTTP_NIIFEDUPERSONATTENDEDCOURSE'
]
.
split
(
';'
):
attended
=
request
.
META
[
'HTTP_NIIFEDUPERSONATTENDEDCOURSE'
]
if
attended
==
''
:
attended
=
[]
else
attended
=
attended
.
split
(
';'
)
for
c
in
attended
:
co
=
Course
.
objects
.
get_or_create
(
code
=
c
)
co
=
Course
.
objects
.
get_or_create
(
code
=
c
)
g
=
co
.
get_or_create_default_group
()
g
=
co
.
get_or_create_default_group
()
if
p
.
course_groups
.
filter
(
semester
=
sem
,
course
=
co
)
.
count
()
==
0
:
if
p
.
course_groups
.
filter
(
semester
=
sem
,
course
=
co
)
.
count
()
==
0
:
...
@@ -59,7 +65,12 @@ def login(request):
...
@@ -59,7 +65,12 @@ def login(request):
except
ValidationError
:
except
ValidationError
:
pass
pass
for
c
in
request
.
META
[
'HTTP_NIIFEDUPERSONHELDCOURSE'
]
.
split
(
';'
):
held
=
request
.
META
[
'HTTP_NIIFEDUPERSONHELDCOURSE'
]
if
held
==
''
:
held
=
[]
else
:
held
=
held
.
split
(
';'
)
for
c
in
held
:
co
=
Course
.
objects
.
get_or_create
(
code
=
c
)
co
=
Course
.
objects
.
get_or_create
(
code
=
c
)
g
=
co
.
get_or_create_default_group
()
g
=
co
.
get_or_create_default_group
()
try
:
try
:
...
...
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