I řešitelskou groupu chceme při registraci dát…
This commit is contained in:
parent
fedb6f7b1c
commit
7b95ea9f89
1 changed files with 3 additions and 1 deletions
|
@ -14,7 +14,7 @@ from django.views.generic.edit import FormView, CreateView
|
|||
from django.views.generic.base import TemplateView, RedirectView
|
||||
from django.contrib.auth import authenticate, login, get_user_model, logout
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.contrib.auth.models import User, Permission
|
||||
from django.contrib.auth.models import User, Permission, Group
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.db import transaction
|
||||
from django.core import serializers
|
||||
|
@ -1189,6 +1189,8 @@ def prihlaskaView(request):
|
|||
u.save()
|
||||
resitel_perm = Permission.objects.filter(codename__exact='resitel').first()
|
||||
u.user_permissions.add(resitel_perm)
|
||||
resitel_grp = Group.objects.filter(codename__exact='resitel').first()
|
||||
u.user_groups.add(resitel_grp)
|
||||
|
||||
o = Osoba(
|
||||
jmeno = fcd['jmeno'],
|
||||
|
|
Loading…
Reference in a new issue