4👍
✅
You can set is_staff
to True
in the .form_valid(…)
method:
class SignUpView(generic.CreateView):
form_class = SignUpCustomUserForm
success_url = reverse_lazy('login')
template_name = 'registration/signup.html'
def form_valid(self, form):
form.instance.is_staff = True
return super().form_valid(form)
Source:stackexchange.com