From 8781e34c98dd5215f346af8efe1bcb98ac412640 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 19 Apr 2024 21:18:57 -0500 Subject: [PATCH] Rename setting for custom user css (remove "buefy") but have to keep support for older setting name for now --- tailbone/subscribers.py | 10 ++++++++-- tailbone/templates/users/preferences.mako | 4 ++-- tailbone/views/users.py | 13 +++++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tailbone/subscribers.py b/tailbone/subscribers.py index 33a9d749..1dc0592a 100644 --- a/tailbone/subscribers.py +++ b/tailbone/subscribers.py @@ -27,6 +27,7 @@ Event Subscribers import six import json import datetime +import warnings import rattail @@ -181,8 +182,13 @@ def before_render(event): # maybe set custom stylesheet css = None if request.user: - css = request.rattail_config.get('tailbone.{}'.format(request.user.uuid), - 'buefy_css') + css = rattail_config.get(f'tailbone.{request.user.uuid}', 'user_css') + if not css: + css = rattail_config.get(f'tailbone.{request.user.uuid}', 'buefy_css') + if css: + warnings.warn(f"setting 'tailbone.{request.user.uuid}.buefy_css' should be" + f"changed to 'tailbone.{request.user.uuid}.user_css'", + DeprecationWarning) renderer_globals['user_css'] = css # add global search data for quick access diff --git a/tailbone/templates/users/preferences.mako b/tailbone/templates/users/preferences.mako index f1432676..c2e17396 100644 --- a/tailbone/templates/users/preferences.mako +++ b/tailbone/templates/users/preferences.mako @@ -27,8 +27,8 @@
-