From f0d9e9f69f52c0b36c39f0513755474b1c420e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Kol=C3=A1=C5=99?= Date: Wed, 18 Sep 2024 20:03:39 +0200 Subject: [PATCH] fix(requests): do not quickmatch user without profile --- fiesta/apps/fiestarequests/forms/editor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fiesta/apps/fiestarequests/forms/editor.py b/fiesta/apps/fiestarequests/forms/editor.py index 56034610..05349760 100644 --- a/fiesta/apps/fiestarequests/forms/editor.py +++ b/fiesta/apps/fiestarequests/forms/editor.py @@ -50,6 +50,11 @@ class Meta: def clean_matcher(self): matcher: User = self.cleaned_data["matcher"] + if not matcher.profile_or_none: + raise ValidationError( + _("This user has not completed their profile. Please ask them to do so before matching.") + ) + if not matcher.profile_or_none.faculty: raise ValidationError(_("This user has not set their faculty. Please ask them to do so or do it yourself."))