mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
avoid missing site variable
This commit is contained in:
parent
2d6e175092
commit
9d1f1a9f14
1 changed files with 5 additions and 1 deletions
|
@ -796,7 +796,11 @@ def current_theme():
|
|||
if current_user.theme is not None and current_user.theme != '':
|
||||
return current_user.theme
|
||||
else:
|
||||
return g.site.default_theme if g.site.default_theme is not None else ''
|
||||
if hasattr(g, 'site'):
|
||||
site = g.site
|
||||
else:
|
||||
site = Site.query.get(1)
|
||||
return site.default_theme if site.default_theme is not None else ''
|
||||
else:
|
||||
return ''
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue