Question: I have a form to update user, the error is on the role field. I am filtering the role based on customer. I am getting the right values for role but anyways the error pops up. Select a valid choice. That choice is not one of the available choices views.py class UserUpdateView(LoginRequiredMixin, SuccessMessageMixin, UpdateView): form_class = UserUpdateForm template_name = 'users/modals/update_profile_modal.html' success_message = "User updated successfully." def get_form_kwargs(self): kw = super().get_form_kwargs() kw['request'] = self.request return kw def get_object(self, *args, **kwargs): user_id = self.request.session['user_detail'] return TbUser.objects.get(id=user_id) def form_invalid(self, form): messages.error(self.request, form.errors) print(form.errors) return redirect('user-detail', pk=self.object.pk) def get_success_url(self): return reverse('user-detail', kwargs={'pk': self.object.pk})  forms.py class UserUpdateForm(forms.ModelForm): email = forms.EmailField() def __init__(self, request, *args, **kwargs): super().__init__(*args, **kwargs) self.request = request if request.user.customer: self.fields['department'].queryset = TbDepartment.objects.filter( customer=request.user.customer) self.fields['role'].queryset = TbRole.objects.filter( customer=request.user.customer) self.fields['username'].required = True self.fields['real_name'].required = True self.fields['email'].required = True self.fields['cellphone'].required = True self.fields['department'].required = True self.fields['role'].required = True class Meta: model = TbUser fields = ['username', 'real_name', 'email', 'cellphone', 'department', 'role']  I am filtering all data using this class, each customer has its own row in the table. class TbCustomer(models.Model): id = models.CharField(primary_key=True, max_length=50) short_name = models.CharField(max_length=255) names = models.CharField(max_length=255) descs = models.CharField(max_length=255, blank=True, null=True) creat_time = models.DateTimeField() creat_user = models.CharField(max_length=255) authenticationcode = models.CharField( db_column='authenticationCode', max_length=255, blank=True, null=True) is_available = models.IntegerField(blank=True, null=True) logo_img = models.CharField(max_length=40, blank=True, null=True) response_message = models.CharField(max_length=100, blank=True, null=True) language = models.CharField(max_length=20, blank=True, null=True) class Meta: managed = False db_table = 'tb_customer' def __str__(self): return '%s' % self.short_name  I am rendering the form using {{form|crispy}} {% block modal %} {% load static %} {% load crispy_forms_tags %} <!-- Modal --> <div class="modal fade" data-backdrop="static" data-keyboard="false" id="tb-user-profile-update-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog modal-sm" role="document"> <div class="modal-content"> <form enctype="multipart/form-data" action="{% url 'tb-user-update' pk=user.id %}" method="POST"> <div class="row d-flex justify-content-center"> <div class="col-10"> <fieldset class="form-group mt-2"> {{user.username}} {% csrf_token %} {{form|crispy}} </fieldset> <div class="form-group"> <button class="btn btn-secondary" type="submit"> <span>Update</span> </button> <button class="btn btn-secondary" type="button" data-dismiss="modal"> <span>Close</span> </button> </div> </div> </div> </form> </div> </div> </div> {% endblock modal %} 

Answer: I have removed the role feature, it was redundant in my project.