mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 14:04:20 +01:00
@@ -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
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user