Remove ajax_select from rootplace

This commit is contained in:
Antoine Bartuccio 2024-10-20 20:50:27 +02:00
parent 7f8a2c1eaf
commit a950585a02

View File

@ -23,7 +23,6 @@
# #
import logging import logging
from ajax_select.fields import AutoCompleteSelectField
from django import forms from django import forms
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.urls import reverse from django.urls import reverse
@ -35,6 +34,7 @@ from django.views.generic.edit import FormView
from core.models import OperationLog, SithFile, User from core.models import OperationLog, SithFile, User
from core.views import CanEditPropMixin from core.views import CanEditPropMixin
from core.views.widgets.select import AutoCompleteSelectUser
from counter.models import Customer from counter.models import Customer
from forum.models import ForumMessageMeta from forum.models import ForumMessageMeta
@ -156,17 +156,29 @@ def delete_all_forum_user_messages(
class MergeForm(forms.Form): class MergeForm(forms.Form):
user1 = AutoCompleteSelectField( user1 = forms.ModelChoiceField(
"users", label=_("User that will be kept"), help_text=None, required=True label=_("User that will be kept"),
help_text=None,
required=True,
widget=AutoCompleteSelectUser,
queryset=User.objects.all(),
) )
user2 = AutoCompleteSelectField( user2 = forms.ModelChoiceField(
"users", label=_("User that will be deleted"), help_text=None, required=True label=_("User that will be deleted"),
help_text=None,
required=True,
widget=AutoCompleteSelectUser,
queryset=User.objects.all(),
) )
class SelectUserForm(forms.Form): class SelectUserForm(forms.Form):
user = AutoCompleteSelectField( user = forms.ModelChoiceField(
"users", label=_("User to be selected"), help_text=None, required=True label=_("User to be selected"),
help_text=None,
required=True,
widget=AutoCompleteSelectUser,
queryset=User.objects.all(),
) )