|
|
@ -84,7 +84,7 @@ def distribusi(): |
|
|
|
zipfilename = "{}.zip".format(distribusi.distribusiname) |
|
|
|
userfolder = os.path.join("stash", distribusi.distribusiname) |
|
|
|
unzipfile = os.path.join(userfolder, zipfilename) |
|
|
|
print(unzipfile) |
|
|
|
|
|
|
|
if os.path.exists(unzipfile): |
|
|
|
with zipfile.ZipFile(unzipfile, "r") as zip_ref: |
|
|
|
# To do, replace extractall with inspection and extract |
|
|
@ -100,6 +100,8 @@ def distribusi(): |
|
|
|
parser = build_argparser() |
|
|
|
args = parser.parse_args(["-s", cssfile]) |
|
|
|
distribusify(args, userfolder) |
|
|
|
distribusi.visible = True |
|
|
|
db.session.commit() |
|
|
|
return redirect(url_for("index")) |
|
|
|
template = render_template( |
|
|
|
"distribusi.html", |
|
|
@ -162,9 +164,6 @@ def upload(): |
|
|
|
shutil.copy(copyzipfile, newuserfolder) |
|
|
|
os.remove(os.path.join(APP.config["UPLOAD_FOLDER"], zipfilename)) |
|
|
|
files_uploaded = AreFilesUploaded() |
|
|
|
else: |
|
|
|
print("there is a problem with form validation") |
|
|
|
print(uploadform.course.data) |
|
|
|
template = render_template( |
|
|
|
"distribusi.html", |
|
|
|
uploadform=uploadform, |
|
|
|