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:
co-authored by
Claude Fable 5.1
parent
89d419ff7b
commit
579ad6f50d
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user