From 88f1fbe2eb0166b91b1f73f80fb021fd838eb5d0 Mon Sep 17 00:00:00 2001 From: tangxuan <2233783319@qq.com> Date: Mon, 3 Apr 2023 15:38:03 +0800 Subject: [PATCH] =?UTF-8?q?str=E4=B8=8E=E6=97=A5=E6=9C=9F=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E5=BC=82=E5=B8=B8=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db_logic/medicament.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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