From b4b859dc8b317561a8544cc56520c7ff4b6efe02 Mon Sep 17 00:00:00 2001 From: George Katsikas <giorgakis.katsikas@gmail.com> Date: Wed, 29 Nov 2023 12:42:56 +0100 Subject: [PATCH] recompute the queryset for merging profiles to handle new ones --- scipost_django/profiles/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scipost_django/profiles/forms.py b/scipost_django/profiles/forms.py index bfe378501..26e31ef39 100644 --- a/scipost_django/profiles/forms.py +++ b/scipost_django/profiles/forms.py @@ -117,18 +117,18 @@ class SimpleProfileForm(ProfileForm): class ProfileMergeForm(forms.Form): to_merge = ModelChoiceFieldwithid( - queryset=Profile.objects.potential_duplicates(), + queryset=Profile.objects.none(), empty_label=None, label="Merge this profile", ) to_merge_into = ModelChoiceFieldwithid( - queryset=Profile.objects.potential_duplicates(), + queryset=Profile.objects.none(), empty_label=None, label="into this profile", ) def __init__(self, *args, **kwargs): - queryset = kwargs.pop("queryset", None) + queryset = kwargs.pop("queryset", Profile.objects.potential_duplicates()) super().__init__(*args, **kwargs) if queryset: self.fields["to_merge"].queryset = queryset -- GitLab