fix #1949 not add time to all place (#1951)

This commit is contained in:
Allen Guan
2021-07-18 16:14:09 +08:00
committed by GitHub
parent 13e36f8947
commit fabdb291e2
2 changed files with 2 additions and 2 deletions

View File

@@ -110,7 +110,7 @@ def import_ctf():
def export_ctf(): def export_ctf():
backup = export_ctf_util() backup = export_ctf_util()
ctf_name = ctf_config.ctf_name() ctf_name = ctf_config.ctf_name()
day = datetime.datetime.now().strftime("%Y-%m-%d") day = datetime.datetime.now().strftime("%Y-%m-%d_%T")
full_name = u"{}.{}.zip".format(ctf_name, day) full_name = u"{}.{}.zip".format(ctf_name, day)
return send_file( return send_file(
backup, cache_timeout=-1, as_attachment=True, attachment_filename=full_name backup, cache_timeout=-1, as_attachment=True, attachment_filename=full_name

View File

@@ -61,7 +61,7 @@ def export_ctf(path=None):
shutil.copyfileobj(backup, target) shutil.copyfileobj(backup, target)
else: else:
name = ctf_name() name = ctf_name()
day = datetime.datetime.now().strftime("%Y-%m-%d") day = datetime.datetime.now().strftime("%Y-%m-%d_%T")
full_name = f"{name}.{day}.zip" full_name = f"{name}.{day}.zip"
with open(full_name, "wb") as target: with open(full_name, "wb") as target: