The lint lets an invite form ask for a phone number instead of an address

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GT37Z1Xtfd9pUuQtMTg6Yt
This commit is contained in:
Bendik Aagaard Lynghaug
2026-09-30 14:09:49 +02:00
co-authored by Claude Fable 5.1
parent 89d419ff7b
commit 579ad6f50d
2 changed files with 9 additions and 2 deletions
+5 -2
View File
@@ -278,9 +278,12 @@ pub fn validate_questions(
.flat_map(|f| &f.requirements)
.any(|r| r.name == name && !r.optional)
};
if !has("name") || !has("email") {
// A person is known by a phone number or an address;
// either will do, since memberships key on the number
// first and Kanidm on the address.
if !has("name") || !(has("email") || has("phone")) {
anyhow::bail!(
"question {:?} alternative {:?}: an invite must collect required `name` and `email` fields",
"question {:?} alternative {:?}: an invite must collect a required `name` and a required `email` or `phone` field",
question.id, alternative.name
);
}