forked from crunk/distribusi-verse
read write file, small fix
This commit is contained in:
parent
d5369bc142
commit
a11a263878
@ -58,10 +58,12 @@ def SaveUploadCssFile(editorform, newcssfolder):
|
||||
cssfile = editorform.cssfile.data
|
||||
cssfilename = f"{secure_filename(editorform.cssname.data)}.css"
|
||||
cssfile.save(os.path.join(newcssfolder, cssfilename))
|
||||
openfile = open(os.path.join(newcssfolder, cssfilename), 'r+')
|
||||
openfile = open(os.path.join(newcssfolder, cssfilename), 'r')
|
||||
cleancss = bleach.clean(openfile.read())
|
||||
openfile.write(cleancss)
|
||||
openfile.close
|
||||
openfile.close()
|
||||
cleanfile = open(os.path.join(newcssfolder, cssfilename), 'w')
|
||||
cleanfile.write(cleancss)
|
||||
cleanfile.close()
|
||||
|
||||
|
||||
def WriteCssToFile(editorform, newcssfolder):
|
||||
|
Loading…
Reference in New Issue
Block a user