|
|
@ -45,6 +45,7 @@ from forms.themeform import ThemeForm |
|
|
|
from forms.editorform import EditorForm |
|
|
|
|
|
|
|
from statuspengguna.helper import AreFilesUploaded |
|
|
|
|
|
|
|
# Tada! |
|
|
|
from distribusi.cli import build_argparser |
|
|
|
from distribusi.distribusi import distribusify |
|
|
@ -55,7 +56,7 @@ APP = create_app() |
|
|
|
@APP.before_request |
|
|
|
def session_handler(): |
|
|
|
session.permanent = True |
|
|
|
APP.permanent_session_lifetime = timedelta(minutes=1) |
|
|
|
APP.permanent_session_lifetime = timedelta(minutes=30) |
|
|
|
|
|
|
|
|
|
|
|
@APP.route("/") |
|
|
@ -125,15 +126,19 @@ def register(): |
|
|
|
flash("Invalid Entry", "warning") |
|
|
|
except InterfaceError: |
|
|
|
db.session.rollback() |
|
|
|
registerform.email.errors.append("Error connecting to the database") |
|
|
|
registerform.email.errors.append( |
|
|
|
"Error connecting to the database" |
|
|
|
) |
|
|
|
flash("Error connecting to the database", "danger") |
|
|
|
except DatabaseError: |
|
|
|
db.session.rollback() |
|
|
|
registerform.email.errors.append("Error connecting to the database") |
|
|
|
registerform.email.errors.append( |
|
|
|
"Error connecting to the database" |
|
|
|
) |
|
|
|
flash("Error connecting to the database", "danger") |
|
|
|
except BuildError: |
|
|
|
db.session.rollback() |
|
|
|
egisterform.email.errors.append("Unknown error occured!") |
|
|
|
registerform.email.errors.append("Unknown error occured!") |
|
|
|
flash("An error occured !", "danger") |
|
|
|
return render_template("register.html", registerform=registerform) |
|
|
|
|
|
|
@ -244,7 +249,7 @@ def editor(): |
|
|
|
if editorform.validate_on_submit(): |
|
|
|
userfolder = os.path.join("stash", user.distribusiname) |
|
|
|
cssfilename = "{}.css".format(editorform.cssname.data) |
|
|
|
with open(os.path.join(userfolder, cssfilename), 'w') as cssfile: |
|
|
|
with open(os.path.join(userfolder, cssfilename), "w") as cssfile: |
|
|
|
cssfile.write(editorform.css.data) |
|
|
|
cssfile.close |
|
|
|
|
|
|
|