|
@ -5,9 +5,9 @@ from flask import ( |
|
|
render_template, |
|
|
render_template, |
|
|
redirect, |
|
|
redirect, |
|
|
url_for, |
|
|
url_for, |
|
|
|
|
|
flash, |
|
|
) |
|
|
) |
|
|
from sqlalchemy.exc import ( |
|
|
from sqlalchemy.exc import ( |
|
|
IntegrityError, |
|
|
|
|
|
InvalidRequestError, |
|
|
InvalidRequestError, |
|
|
DataError, |
|
|
DataError, |
|
|
InterfaceError, |
|
|
InterfaceError, |
|
@ -77,9 +77,7 @@ def UnzipDistribusiFiles(distribusi, userfolder): |
|
|
|
|
|
|
|
|
def GetCssFile(distribusi): |
|
|
def GetCssFile(distribusi): |
|
|
cssfile = "" |
|
|
cssfile = "" |
|
|
cssfolder = os.path.join( |
|
|
cssfolder = os.path.join("themes/userthemes", distribusi.distribusiname) |
|
|
"themes/userthemes", distribusi.distribusiname |
|
|
|
|
|
) |
|
|
|
|
|
for filename in os.listdir(cssfolder): |
|
|
for filename in os.listdir(cssfolder): |
|
|
if filename.endswith(".css"): |
|
|
if filename.endswith(".css"): |
|
|
cssfile = os.path.join(cssfolder, filename) |
|
|
cssfile = os.path.join(cssfolder, filename) |
|
@ -99,7 +97,7 @@ def SetDistribusiToVisible(distribusi, user): |
|
|
db.session.commit() |
|
|
db.session.commit() |
|
|
except (InvalidRequestError, DataError, InterfaceError, DatabaseError): |
|
|
except (InvalidRequestError, DataError, InterfaceError, DatabaseError): |
|
|
db.session.rollback() |
|
|
db.session.rollback() |
|
|
distribusiform.submit.errors.append("Unknown error occured!") |
|
|
flash("Unknown error occured!") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def DeleteCssFile(cssfile): |
|
|
def DeleteCssFile(cssfile): |
|
|