Conversation
|
|
||
| # Invalid - wrong pattern | ||
| assert UNSC.normalize("QDx.002") is None # 'x' not 'i' or 'e' | ||
| assert UNSC.normalize("qdi.002") is None # lowercase |
There was a problem hiding this comment.
Could/should the class tolerate lowercase or missing dot or even normalize the result?
There was a problem hiding this comment.
I'd rather start on the stricter end and then soften it a bit if necessary. We'll have a good grasp of the data as soon as we roll it out. From what I've seen, it's either perfectly clean or completely broken
|
Nice! I guess the alternative here would be to add a quick regex to |
|
since we have other validators in rigour too, I think it's the most suitable place for it |
Use UNSC ID validation to distinguish genuine UN IDs from Argentine national IDs
Problem
In
ar_repet, we can't distinguish between:QDi.002,CDi.030(7 chars, format:[REGIME][i/e].[NUM])ArP.00234(also 7-9 chars)This causes invalid data in
unscIdfield.Solution
Implement proper UNSC ID validation using pattern
^[A-Z]{2,3}[ie]\.\d{3,}$to: