Description
Hello,
Right now the SIRET and SIREN model fields use SIRET and SIREN form fields that do the validation.
I prefer the architecture of the IBAN and BIC fields in generic that use class Validators,
since you can call the validators without using form fields.
Would you accept if I submit a PR with a new file validators.py in fr/
and add in it SIRENValidator and SIRETValidator classes ?
I would use them as is done for IBANValidator and BICValidator.
There is also an annoying thing :
SIRET is max length 14
but it is formatted with spaces.
Thus if in Django admin you modify a form with a valid SIRET in it you get this error :
"Ensure this value has at most 14 characters (it has 17)."
I don't know what is the nicest way to avoid this :
- remove formatting in
django-localflavor/localflavor/fr/forms.py
Lines 251 to 255 in 80c6584
- change maxlength from 14 to 17 ?
Modifying a SIRET each time you submit a form because of this is an unvolontary "dark pattern" ;)
Thanks, best regards,
Laurent Lyaudet