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