atos_genesys: check year of birth is >= 1900 (#44345)

This commit is contained in:
Benjamin Dauvergne 2020-06-22 22:12:32 +02:00 committed by Frédéric Péters
parent 31cd22bab5
commit 78e46ed475
1 changed files with 2 additions and 0 deletions

View File

@ -368,6 +368,8 @@ class Resource(BaseResource, HTTPResource):
date_of_birth = datetime.datetime.strptime(date_of_birth, '%Y-%m-%d').date()
except (ValueError, TypeError):
raise APIError('invalid date_of_birth: %r' % date_of_birth)
if date_of_birth.year < 1900:
raise APIError('date_of_birth must be >= 1900')
if commune_naissance:
# convert commune_naissance to ASCII
commune_naissance = to_ascii(commune_naissance).lower()