adapt national registry number for people born after 2000

This commit is contained in:
Frédéric Péters 2017-06-14 13:39:54 +02:00
parent c08a33b560
commit ed2a6b05c9
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ class NrnField(forms.CharField):
if not value:
return
try:
if (97 - int(value[:9]) % 97) != int(value[-2:]):
if (97 - int(value[:9]) % 97) != int(value[-2:]) and (97 - int('2' + value[:9]) % 97) != int(value[-2:]):
raise ValueError()
except ValueError:
raise forms.ValidationError(_('Invalid format for national registry number.'))