From 1e994cf7856e20acc0b058a3b6f0f617f8113726 Mon Sep 17 00:00:00 2001 From: k1o0 Date: Tue, 13 Feb 2024 16:49:06 +0200 Subject: [PATCH] Resolves #827 --- alyx/actions/admin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alyx/actions/admin.py b/alyx/actions/admin.py index 73b1c9599..c050063a3 100644 --- a/alyx/actions/admin.py +++ b/alyx/actions/admin.py @@ -390,7 +390,8 @@ def is_water_restricted(self, obj): class WeighingForm(BaseActionForm): def __init__(self, *args, **kwargs): super(WeighingForm, self).__init__(*args, **kwargs) - self.fields['subject'].queryset = self.current_user.get_allowed_subjects() + if 'subject' in self.fields: + self.fields['subject'].queryset = self.current_user.get_allowed_subjects() if self.fields.keys(): self.fields['weight'].widget.attrs.update({'autofocus': 'autofocus'})