mirror of https://github.com/django/django.git
Fixed #3879 -- Updated Norwegian social security validation rules. Thanks,
bp@datakortet.no. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
b11454dc3d
commit
a599f1234e
|
@ -46,10 +46,12 @@ class NOSocialSecurityNumber(Field):
|
||||||
try:
|
try:
|
||||||
if 000 <= inum < 500:
|
if 000 <= inum < 500:
|
||||||
self.birthday = datetime.date(1900+year2, month, day)
|
self.birthday = datetime.date(1900+year2, month, day)
|
||||||
if 500 <= inum < 750:
|
if 500 <= inum < 750 and year2 > 54:
|
||||||
self.birthday = datetime.date(1800+year2, month, day)
|
self.birthday = datetime.date(1800+year2, month, day)
|
||||||
if 500 <= inum < 1000:
|
if 500 <= inum < 1000 and year2 < 40:
|
||||||
self.birthday = datetime.date(2000+year2, month, day)
|
self.birthday = datetime.date(2000+year2, month, day)
|
||||||
|
if 900 <= inum < 1000 and year2 > 39:
|
||||||
|
self.birthday = datetime.date(1900+year2, month, day)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise ValidationError(msg)
|
raise ValidationError(msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue