diff --git a/db_logic/medicament.py b/db_logic/medicament.py index 03a94a0..64f836c 100644 --- a/db_logic/medicament.py +++ b/db_logic/medicament.py @@ -970,7 +970,7 @@ class BllMedicament(Repository): add_year = int(medicament_variety_obj.remark5) if medicament_variety_obj.remark5 else 1 date_now = datetime.datetime.now() add_expiration_date = (date_now + relativedelta(years=add_year)).strftime("%Y-%m-%d %H:%M:%S") - if add_expiration_date > drug_entry.expiration_date: + if not drug_entry.expiration_date or add_expiration_date > str(drug_entry.expiration_date): return else: drug_entry.expiration_date = add_expiration_date