The form_valid() method does not work, although it is valid

I have a Business Type Model that stores business areas, and I also have a BusinessСategory Model that stores business categories based on the general area

Example: Catering - Bar, restaurant, Retail - store, car showroom, etc.

I want to display a form that, using a queryset, will substitute the necessary categories
Дальше планирую сохранять эту информацию, но функция form_falid не работает, хотя в request.POST - есть эта информация

model.py

class BusinessCategory(models.Model):
    title = models.CharField(max_length=50, null=True, blank=True)
    type_id = models.ForeignKey('BusinessType', on_delete=models.PROTECT, verbose_name='Тип бизнеса')

    def __str__(self):
        return self.title

    class Meta:
        verbose_name = "Категория бизнеса"
        verbose_name_plural = "Категории бизнеса"

code forms.py

class BusinessCategoryForm(forms.ModelForm):
    title = forms.ModelChoiceField(
        widget=forms.RadioSelect(),
        queryset=BusinessCategory.objects.none(),
        to_field_name='title',
    )

    class Meta:
        model = BusinessCategory
        fields = ('title', )

    def __init__(self, *args, type_id=None, **kwargs):
        super(BusinessCategoryForm, self).__init__(*args, **kwargs)
        if type_id is not None:
            queryset = BusinessCategory.objects.filter(type_id=type_id)
            self.fields['title'].queryset = queryset

code views.py

class BusinessCategoryView(FormView):
    template_name = 'quiz/category.html'
    success_url = '/'
    form_class = BusinessCategoryForm  # Здесь должно быть определение вашего класса формы


    def get_form(self, form_class=None):
        type_id = self.request.session.get("type")
        return self.form_class(type_id=type_id)

    def form_valid(self, form):
        print("OK")
        category = form.cleaned_data["title"]
        print(category)
        self.request.session["category"] = category.pk
        user = User.objects.get(email=self.request.session["user_email"])
        user.cat = category
        user.save()
        return super().form_valid(form)

    def form_invalid(self, form):
        print("Form is invalid")
        print(self.request.POST)
        return super().form_invalid(form)

print(“OK”) don’t work

{% block content %}
<h2>Choose Business Categories</h2>
    <form method="post">
        {% csrf_token %}
        {{ form.as_p }}
{{form.errors }}

        <button type="submit">Submit</button>
    </form>

{% endblock %}

Help me, pls

Trying to resolve this is going to require some more investigation on your part.

Either using a debugger or adding some print statements, you’re going to want to confirm that the session contains the value you’re expecting it to have, and that the queryset in your form’s __init__ function is getting the right results and that the form being returned by get_form is correct.

What methods should I try?
I tried to override the post method in BusinessCategoryView, but it didn’t work. the self.is_valid() method returns False, but there are no errors inside

Am I getting the queryset correctly? There may be an error in the form…

We can’t determine that from what you have here. That’s why you need to do the debugging. You’ll need to verify data at every key location where it’s being used.