Reset theme when removing custom font

main
Bob Mottram 2020-05-26 22:02:06 +01:00
parent 84def5e4aa
commit 80a9634572
1 changed files with 14 additions and 16 deletions

View File

@ -5792,22 +5792,20 @@ class PubServer(BaseHTTPRequestHandler):
if fields.get('removeCustomFont'):
if fields['removeCustomFont'] == 'on':
if os.path.isfile(self.server.baseDir +
'/fonts/custom.woff'):
os.remove(self.server.baseDir +
'/fonts/custom.woff')
elif os.path.isfile(self.server.baseDir +
'/fonts/custom.woff2'):
os.remove(self.server.baseDir +
'/fonts/custom.woff2')
elif os.path.isfile(self.server.baseDir +
'/fonts/custom.otf'):
os.remove(self.server.baseDir +
'/fonts/custom.otf')
elif os.path.isfile(self.server.baseDir +
'/fonts/custom.ttf'):
os.remove(self.server.baseDir +
'/fonts/custom.ttf')
fontExt = ('woff', 'woff2', 'otf', 'ttf')
for ext in fontExt:
if os.path.isfile(self.server.baseDir +
'/fonts/custom.' + ext):
os.remove(self.server.baseDir +
'/fonts/custom.' + ext)
setTheme(self.server.baseDir,
getTheme(self.server.baseDir))
if os.path.isfile(self.server.baseDir +
'/fonts/custom.' + ext +
'.etag'):
os.remove(self.server.baseDir +
'/fonts/custom.' + ext +
'.etag')
if fields.get('mediaInstance'):
self.server.mediaInstance = False