Set instance type earlier

main
Bob Mottram 2020-10-13 21:19:23 +01:00
parent 62124c199b
commit e34828bfd0
1 changed files with 28 additions and 26 deletions

View File

@ -3328,6 +3328,34 @@ class PubServer(BaseHTTPRequestHandler):
if fields['displayNickname'] != actorJson['name']:
actorJson['name'] = fields['displayNickname']
actorChanged = True
# change media instance status
if fields.get('mediaInstance'):
self.server.mediaInstance = False
self.server.defaultTimeline = 'inbox'
if fields['mediaInstance'] == 'on':
self.server.mediaInstance = True
self.server.blogsInstance = False
self.server.newsInstance = False
self.server.defaultTimeline = 'tlmedia'
setConfigParam(baseDir,
"mediaInstance",
self.server.mediaInstance)
setConfigParam(baseDir,
"blogsInstance",
self.server.blogsInstance)
setConfigParam(baseDir,
"newsInstance",
self.server.newsInstance)
else:
if self.server.mediaInstance:
self.server.mediaInstance = False
self.server.defaultTimeline = 'inbox'
setConfigParam(baseDir,
"mediaInstance",
self.server.mediaInstance)
# change theme
if fields.get('themeDropdown'):
setTheme(baseDir,
fields['themeDropdown'],
@ -3672,32 +3700,6 @@ class PubServer(BaseHTTPRequestHandler):
if currTheme:
setTheme(baseDir, currTheme, domain)
# change media instance status
if fields.get('mediaInstance'):
self.server.mediaInstance = False
self.server.defaultTimeline = 'inbox'
if fields['mediaInstance'] == 'on':
self.server.mediaInstance = True
self.server.blogsInstance = False
self.server.newsInstance = False
self.server.defaultTimeline = 'tlmedia'
setConfigParam(baseDir,
"mediaInstance",
self.server.mediaInstance)
setConfigParam(baseDir,
"blogsInstance",
self.server.blogsInstance)
setConfigParam(baseDir,
"newsInstance",
self.server.newsInstance)
else:
if self.server.mediaInstance:
self.server.mediaInstance = False
self.server.defaultTimeline = 'inbox'
setConfigParam(baseDir,
"mediaInstance",
self.server.mediaInstance)
# change news instance status
if fields.get('newsInstance'):
self.server.newsInstance = False