Les vaccins sont valables 7 jours après la dernière dose
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
parent
f542f6646d
commit
a830551258
|
@ -107,8 +107,15 @@ def analyse_qrcode(qrcode: str, additional_info: bool = False,
|
|||
p = payload[-260][1]
|
||||
|
||||
if 'v' in p:
|
||||
# Les vaccins sont toujours valide
|
||||
valid = valid and True
|
||||
# Les vaccins sont valides 7 jours après la dernière dose
|
||||
vaccin = p['v'][0]
|
||||
# Toutes les doses sont requises
|
||||
valid = valid and vaccin['dn'] == vaccin['sd']
|
||||
# Vérification de la date
|
||||
date = datetime.date.fromisoformat(vaccin['dt'])
|
||||
today = datetime.date.today()
|
||||
delta = today - date
|
||||
valid = valid and delta.days >= 7
|
||||
elif 't' in p:
|
||||
# Les tests négatifs sont valables moins de 72h
|
||||
test = p['t'][0]
|
||||
|
|
Loading…
Reference in New Issue