diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-01 05:00:44 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-01 05:00:44 +0000 |
| commit | a599f1234eb7e511aa2c0766873750ad70390aaf (patch) | |
| tree | 14963dbc82547a4d6a7bc79c74384c4fde42abfd | |
| parent | b11454dc3d3e844ddda11db5ed363af726340855 (diff) | |
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
| -rw-r--r-- | django/contrib/localflavor/no/forms.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/django/contrib/localflavor/no/forms.py b/django/contrib/localflavor/no/forms.py index 468dde462d..22099005b9 100644 --- a/django/contrib/localflavor/no/forms.py +++ b/django/contrib/localflavor/no/forms.py @@ -46,10 +46,12 @@ class NOSocialSecurityNumber(Field): try: if 000 <= inum < 500: 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) - if 500 <= inum < 1000: + if 500 <= inum < 1000 and year2 < 40: 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: raise ValidationError(msg) |
