Check that directory exists

merge-requests/8/head
Bob Mottram 2020-11-20 09:34:31 +00:00
parent 97119e05c5
commit b889c8dfdd
1 changed files with 5 additions and 4 deletions

View File

@ -615,10 +615,11 @@ def setTheme(baseDir: str, name: str, domain: str) -> bool:
# set the news avatar
newsAvatarThemeFilename = \
baseDir + '/theme/' + name + '/icons/avatar_news.png'
if os.path.isfile(newsAvatarThemeFilename):
newsAvatarFilename = \
baseDir + '/accounts/news@' + domain + '/avatar.png'
copyfile(newsAvatarThemeFilename, newsAvatarFilename)
if os.path.isdir(baseDir + '/accounts/news@' + domain):
if os.path.isfile(newsAvatarThemeFilename):
newsAvatarFilename = \
baseDir + '/accounts/news@' + domain + '/avatar.png'
copyfile(newsAvatarThemeFilename, newsAvatarFilename)
grayscaleFilename = baseDir + '/accounts/.grayscale'
if os.path.isfile(grayscaleFilename):