From a21460a1b8abd4de5efe5fbe5d13336ae74c5ab8 Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 20 Oct 2024 22:36:55 +0200 Subject: [PATCH] Remove ajax_select from subscriptions --- subscription/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subscription/views.py b/subscription/views.py index a508513f..4abc8e83 100644 --- a/subscription/views.py +++ b/subscription/views.py @@ -15,7 +15,6 @@ import random -from ajax_select.fields import AutoCompleteSelectField from django import forms from django.conf import settings from django.core.exceptions import PermissionDenied, ValidationError @@ -25,6 +24,7 @@ from django.views.generic.edit import CreateView, FormView from core.models import User from core.views.forms import SelectDate, SelectDateTime +from core.views.widgets.select import AutoCompleteSelectUser from subscription.models import Subscription @@ -43,11 +43,11 @@ class SubscriptionForm(forms.ModelForm): class Meta: model = Subscription fields = ["member", "subscription_type", "payment_method", "location"] - - member = AutoCompleteSelectField("users", required=False, help_text=None) + widgets = {"member": AutoCompleteSelectUser} def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) + self.fields["member"].required = False self.fields |= forms.fields_for_model( User, fields=["first_name", "last_name", "email", "date_of_birth"],