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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
52fc900b
authored
Feb 03, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
school: handle affiliation
parent
df7ff74d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
school/views.py
+10
-1
No files found.
school/views.py
View file @
52fc900b
...
...
@@ -2,7 +2,7 @@ from datetime import datetime
from
django.core.exceptions
import
ValidationError
from
django.conf
import
settings
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
,
Group
as
AGroup
from
django.contrib
import
messages
from
django.core.exceptions
import
PermissionDenied
from
django.core
import
signing
...
...
@@ -89,6 +89,15 @@ def login(request):
g
.
save
()
affiliation
=
request
.
META
[
'affiliation'
]
if
affiliation
==
''
:
affiliation
=
[]
else
:
affiliation
=
affiliation
.
split
(
';'
)
for
a
in
affiliation
:
g
,
created
=
AGroup
.
objects
.
get_or_create
(
name
=
a
)
user
.
groups
.
add
(
g
)
user
.
save
()
p
.
save
()
user
.
backend
=
'django.contrib.auth.backends.ModelBackend'
...
...
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