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.get('removeCustomFont'):
if fields['removeCustomFont'] == 'on': if fields['removeCustomFont'] == 'on':
if os.path.isfile(self.server.baseDir + fontExt = ('woff', 'woff2', 'otf', 'ttf')
'/fonts/custom.woff'): for ext in fontExt:
os.remove(self.server.baseDir + if os.path.isfile(self.server.baseDir +
'/fonts/custom.woff') '/fonts/custom.' + ext):
elif os.path.isfile(self.server.baseDir + os.remove(self.server.baseDir +
'/fonts/custom.woff2'): '/fonts/custom.' + ext)
os.remove(self.server.baseDir + setTheme(self.server.baseDir,
'/fonts/custom.woff2') getTheme(self.server.baseDir))
elif os.path.isfile(self.server.baseDir + if os.path.isfile(self.server.baseDir +
'/fonts/custom.otf'): '/fonts/custom.' + ext +
os.remove(self.server.baseDir + '.etag'):
'/fonts/custom.otf') os.remove(self.server.baseDir +
elif os.path.isfile(self.server.baseDir + '/fonts/custom.' + ext +
'/fonts/custom.ttf'): '.etag')
os.remove(self.server.baseDir +
'/fonts/custom.ttf')
if fields.get('mediaInstance'): if fields.get('mediaInstance'):
self.server.mediaInstance = False self.server.mediaInstance = False