From fc8365c3dc66406dbab8f5dcfc4e941ae16cf537 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Mon, 22 Jun 2020 22:12:32 +0200 Subject: [PATCH] atos_genesys: check dob is >= 1900 (#44345) --- passerelle/apps/atos_genesys/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/passerelle/apps/atos_genesys/models.py b/passerelle/apps/atos_genesys/models.py index a1fd5802..4f1ab273 100644 --- a/passerelle/apps/atos_genesys/models.py +++ b/passerelle/apps/atos_genesys/models.py @@ -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() -- 2.26.2