str与日期比较异常修复

duizhaopin
tangxuan 2 years ago
parent 7df6063b3b
commit 88f1fbe2eb

@ -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

Loading…
Cancel
Save