|
|
@ -83,16 +83,19 @@ def DeleteDistribusi(distribusiname): |
|
|
|
db.session.delete(distribusi) |
|
|
|
db.session.commit() |
|
|
|
userfolder = os.path.join("stash", distribusi.distribusiname) |
|
|
|
shutil.rmtree(userfolder) |
|
|
|
if os.path.exists(userfolder): |
|
|
|
shutil.rmtree(userfolder) |
|
|
|
cssfolder = os.path.join( |
|
|
|
"themes/userthemes", distribusi.distribusiname |
|
|
|
) |
|
|
|
shutil.rmtree(cssfolder) |
|
|
|
if os.path.exists(cssfolder): |
|
|
|
shutil.rmtree(cssfolder) |
|
|
|
if distribusi.publictheme is not None: |
|
|
|
publicthemefolder = os.path.join( |
|
|
|
"themes/publicthemes", distribusi.distribusiname |
|
|
|
) |
|
|
|
shutil.rmtree(publicthemefolder) |
|
|
|
if os.path.exists(publicthemefolder): |
|
|
|
shutil.rmtree(publicthemefolder) |
|
|
|
# SelectField error is list is a tuple?? why?? |
|
|
|
# selectorform.distribusis.errors.append("Distribusi deleted!") |
|
|
|
except (InvalidRequestError, DataError, InterfaceError, DatabaseError): |
|
|
|