hey man, sorry I was very busy.
just now got the time, so I wrote this in like 15 minutes, there is
probably better solution but is working and I will check for something
better tomorrow.
first of all I didn't have time to create abstract user so I worked with
standard django user + model korisnik
12 class SignUp(PermissionRequiredMixin, generic.CreateView):
13 form_class = WiggenUserCreationForm
14 success_url = reverse_lazy('check_users')
15 template_name = 'registration/signup.html'
16 login_url = '/konton/login'
17 permission_required = 'users.add_user'
18
you can do it from views.py inside signup function
if Försäljningschef
then if exist() sign there, if not create that group.
I will be at home in few hours so can write one full example if you can't
make it until then.
нед, 6. јан 2019. у 18:55 Robin Riis је написао/ла:
> i have a custom user m
i have a custom user model that i want to have 4 default groups depending
on job title.
this is my model.py
1 from django.contrib.auth.models import AbstractUser, UserManager,
PermissionsMixin
2 from django.db import models
3
4 class WiggenUserManager(UserManager):
5 pass
6
7
4 matches
Mail list logo