Browse Source

I řešitelskou groupu chceme při registraci dát…

middleware_test
Pavel "LEdoian" Turinsky 3 years ago
parent
commit
7b95ea9f89
  1. 4
      seminar/views/views_all.py

4
seminar/views/views_all.py

@ -14,7 +14,7 @@ from django.views.generic.edit import FormView, CreateView
from django.views.generic.base import TemplateView, RedirectView from django.views.generic.base import TemplateView, RedirectView
from django.contrib.auth import authenticate, login, get_user_model, logout from django.contrib.auth import authenticate, login, get_user_model, logout
from django.contrib.auth import views as auth_views 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.contrib.auth.mixins import LoginRequiredMixin
from django.db import transaction from django.db import transaction
from django.core import serializers from django.core import serializers
@ -1189,6 +1189,8 @@ def prihlaskaView(request):
u.save() u.save()
resitel_perm = Permission.objects.filter(codename__exact='resitel').first() resitel_perm = Permission.objects.filter(codename__exact='resitel').first()
u.user_permissions.add(resitel_perm) u.user_permissions.add(resitel_perm)
resitel_grp = Group.objects.filter(codename__exact='resitel').first()
u.user_groups.add(resitel_grp)
o = Osoba( o = Osoba(
jmeno = fcd['jmeno'], jmeno = fcd['jmeno'],

Loading…
Cancel
Save