diff --git a/web/pgadmin/misc/__init__.py b/web/pgadmin/misc/__init__.py index a9466bafa20..153f3191aab 100644 --- a/web/pgadmin/misc/__init__.py +++ b/web/pgadmin/misc/__init__.py @@ -70,10 +70,8 @@ def register_preferences(self): .replace('-', ' ') .title(), 'value': theme, - 'preview_src': url_for( - 'static', filename='js/generated/img/' + - theme_data['preview_img'] - ) if 'preview_img' in theme_data else None + 'preview_src': 'js/generated/img/' + theme_data['preview_img'] + if 'preview_img' in theme_data else None }) self.preference.register( diff --git a/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx b/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx index 085eb32a06e..05baaf0afcb 100644 --- a/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx +++ b/web/pgadmin/preferences/static/js/components/PreferencesComponent.jsx @@ -295,6 +295,7 @@ export default function PreferencesComponent({ ...props }) { } else { opt.selected = false; } + opt.preview_src = opt.preview_src && url_for('static', { filename: opt.preview_src }); }); } }