Require name initials for DUA signing (#2106)#2558
Require name initials for DUA signing (#2106)#2558lukepayyapilli merged 4 commits intoMIT-LCP:devfrom
Conversation
Oof. If you want to open that can of worms, it's gotta be at least not merely This is a good thing to read if you haven't: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/ Frankly, I'd scrap the whole idea, or accept anything that vaguely approximates the given name and family name fields that appear in the profile. |
|
Relaxing the rules is reasonable, but requiring something beyond a thoughtless click is important. This doesn't solve all our problems, but it moves us in a good direction. One option is just to tell people what to type. e.g. Please type your initials below, exactly as they appear here: "LP". If we really don't like initials, then an alternative option is to type a statement. e.g. "I agree" |
|
Thats a good point @bemoody - thanks! I can do as @tompollard suggests and change it to a phrase but a phrase would imply the language is english. I think that's a fair assumption given the agreement is in english also but happy to modify to whatever phrase we'd like to. Let me know what you both prefer? |
|
Hmm. Initials might not be a bad idea. Not just less to get wrong, but less annoyin for the person to type. |
|
Adding some friction to the process isn't necessarily a bad thing. @lukepayyapilli Let's go with initials then! |
|
ready @tompollard! |
Summary
Approach
Business logic in the model: The initials validation rule lives in
DUASignature.validate_signature_initials()as a static method. This keeps the business rule testable and reusable.Unicode-aware comparison: Uses
unicodedata.normalize('NFKD', text.casefold())for proper unicode handling per review feedback.Simple Form:
DUASignatureFormis a plain Django Form that only collects data. It delegates validation to the model's static method.Explicit view logic: The view explicitly creates the
DUASignatureobject, making it clear what's being persisted.Screenshots
Closes #2106