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