mdph13: only validate valued date fields (#31279)
This commit is contained in:
parent
b8b8d140f6
commit
52522274e6
|
@ -157,8 +157,8 @@ class MDPH13Resource(BaseResource, HTTPResource):
|
|||
|
||||
def check(value, path):
|
||||
if path[-1].startswith('date_'):
|
||||
if (not isinstance(value, six.text_type)
|
||||
or not self.DATE_RE.match(value)):
|
||||
if (isinstance(value, six.text_type)
|
||||
and not self.DATE_RE.match(value)):
|
||||
errors.append('%s is not a date string' % '.'.join(path))
|
||||
json_walker(data, check)
|
||||
if errors:
|
||||
|
|
|
@ -93,7 +93,7 @@ VALID_RESPONSE = json.dumps({
|
|||
"prestation": "Carte d'invalidité (de priorité) pour personne handicapée",
|
||||
"statut": "Instruction administrative terminée en attente de passage en évaluation",
|
||||
"typologie": "Demande En Cours",
|
||||
"date_decision": "2015-01-16"
|
||||
"date_decision": None,
|
||||
},
|
||||
{
|
||||
"numero": "1210524",
|
||||
|
|
Loading…
Reference in New Issue