Skip to content

Commit

Permalink
Booster logic (#42)
Browse files Browse the repository at this point in the history
The booster certificate can contain the exact number of doses (e.g. 3/3,
2/2) or a bigger number than the total doses (3/2, 2/1).
  • Loading branch information
berdav authored Jan 21, 2022
1 parent 0e67fe8 commit b974701
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion greenpass/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def verify_certificate(cert, sm, cup,
# Check vaccine validity
if certificate_type == "vaccine":
hours_to_valid, remaining_hours = sm.get_vaccine_remaining_time(
vaccinedate, vaccine, dn == sd
vaccinedate, vaccine, dn >= sd
)

# Check recovery validity
Expand Down
2 changes: 1 addition & 1 deletion greenpass/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def _print_common_fields(self, cert, km, cachedir):
)

def _print_vaccine_fields(self, cert, km, cachedir):
if cert.get_dose_number() == cert.get_total_doses():
if cert.get_dose_number() >= cert.get_total_doses():
printfun = self.add_cert_info_ok
else:
printfun = self.add_cert_info_warning
Expand Down

0 comments on commit b974701

Please sign in to comment.