FIX: don't check if elementes are older than 30 days if all module check

This commit is contained in:
Germann Elsa Sylvia
2023-03-28 16:09:55 +02:00
parent dfff0abc1c
commit 6f5acc2411

View File

@ -21,14 +21,14 @@ def asciidoc_json_dump(list, name, steps, Pmodules_db_path):
if name != "all":
with open(db_file, "r") as f:
matrix_db = json.load(f)
temp_matrix_db = matrix_db.copy()
for elem in matrix_db:
if (
datetime.strptime(elem[-1], "%Y-%m-%d") + timedelta(days=30)
< datetime.now()
):
temp_matrix_db.remove(elem)
matrix_db = temp_matrix_db
temp_matrix_db = matrix_db.copy()
for elem in matrix_db:
if (
datetime.strptime(elem[-1], "%Y-%m-%d") + timedelta(days=30)
< datetime.now()
):
temp_matrix_db.remove(elem)
matrix_db = temp_matrix_db
# Update the database for new changes
if len(list) != 0: