|
|
@ -4,7 +4,6 @@ import zipfile |
|
|
|
import shutil |
|
|
|
from datetime import timedelta |
|
|
|
|
|
|
|
|
|
|
|
from flask import ( |
|
|
|
render_template, |
|
|
|
redirect, |
|
|
@ -32,20 +31,24 @@ from forms.editorform import EditorForm |
|
|
|
from forms.selectorform import SelectorForm |
|
|
|
|
|
|
|
# CRUD! |
|
|
|
from selector import SelectNewDistribusi |
|
|
|
from selector import SelectUpdateDistribusi |
|
|
|
from selector import DeleteDistribusi |
|
|
|
from selector import SelectorVisible |
|
|
|
from selector import ( |
|
|
|
SelectNewDistribusi, |
|
|
|
SelectUpdateDistribusi, |
|
|
|
DeleteDistribusi, |
|
|
|
SelectorVisible, |
|
|
|
) |
|
|
|
|
|
|
|
# Upload |
|
|
|
from upload import UploadNewDistribusi |
|
|
|
from upload import UploadUpdatedFiles |
|
|
|
from upload import UploadNewDistribusi, UploadUpdatedFiles |
|
|
|
|
|
|
|
# UserPengguna |
|
|
|
from statuspengguna.helper import IsZipUploaded |
|
|
|
from statuspengguna.helper import IsCssSelected |
|
|
|
from statuspengguna.helper import CurrentDistribusi |
|
|
|
from statuspengguna.helper import ResetUserState |
|
|
|
from statuspengguna.helper import ( |
|
|
|
IsZipUploaded, |
|
|
|
IsCssSelected, |
|
|
|
CurrentDistribusi, |
|
|
|
HasDistribusi, |
|
|
|
ResetUserState, |
|
|
|
) |
|
|
|
from statuspengguna.loginuser import LoginUser |
|
|
|
from statuspengguna.registeruser import RegisterUser |
|
|
|
|
|
|
@ -73,7 +76,7 @@ def index(): |
|
|
|
for distribusi in distribusis: |
|
|
|
user = User.query.filter_by(id=distribusi.userid).first() |
|
|
|
singledistribusi = { |
|
|
|
"useremail": user.email, |
|
|
|
"username": user.username, |
|
|
|
"term": distribusi.term, |
|
|
|
"course": distribusi.course, |
|
|
|
"year": distribusi.year, |
|
|
@ -160,7 +163,7 @@ def upload(): |
|
|
|
selectorvisible = SelectorVisible() |
|
|
|
|
|
|
|
current_distribusi = CurrentDistribusi() |
|
|
|
if current_distribusi == "new": |
|
|
|
if current_distribusi == "new" or HasDistribusi() == False: |
|
|
|
uploadform = UploadNewDistribusi(APP.config["UPLOAD_FOLDER"]) |
|
|
|
else: |
|
|
|
uploadform = UploadUpdatedFiles(APP.config["UPLOAD_FOLDER"]) |
|
|
|