From a950585a02a9fd94055faea9e9e3bce5b46ac7c2 Mon Sep 17 00:00:00 2001 From: Sli Date: Sun, 20 Oct 2024 20:50:27 +0200 Subject: [PATCH] Remove ajax_select from rootplace --- rootplace/views.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/rootplace/views.py b/rootplace/views.py index 4aefb8c3..4bd3c882 100644 --- a/rootplace/views.py +++ b/rootplace/views.py @@ -23,7 +23,6 @@ # import logging -from ajax_select.fields import AutoCompleteSelectField from django import forms from django.core.exceptions import PermissionDenied 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.views import CanEditPropMixin +from core.views.widgets.select import AutoCompleteSelectUser from counter.models import Customer from forum.models import ForumMessageMeta @@ -156,17 +156,29 @@ def delete_all_forum_user_messages( class MergeForm(forms.Form): - user1 = AutoCompleteSelectField( - "users", label=_("User that will be kept"), help_text=None, required=True + user1 = forms.ModelChoiceField( + label=_("User that will be kept"), + help_text=None, + required=True, + widget=AutoCompleteSelectUser, + queryset=User.objects.all(), ) - user2 = AutoCompleteSelectField( - "users", label=_("User that will be deleted"), help_text=None, required=True + user2 = forms.ModelChoiceField( + label=_("User that will be deleted"), + help_text=None, + required=True, + widget=AutoCompleteSelectUser, + queryset=User.objects.all(), ) class SelectUserForm(forms.Form): - user = AutoCompleteSelectField( - "users", label=_("User to be selected"), help_text=None, required=True + user = forms.ModelChoiceField( + label=_("User to be selected"), + help_text=None, + required=True, + widget=AutoCompleteSelectUser, + queryset=User.objects.all(), )