gabotorresruiz commented on code in PR #35220:
URL: https://github.com/apache/superset/pull/35220#discussion_r2373173328


##########
superset/views/base.py:
##########
@@ -311,66 +311,76 @@ def menu_data(user: User) -> dict[str, Any]:
     }
 
 
+# Determine if themes need to fall back to base themes
+# A theme needs fallback if it's None or empty
+def should_use_base(theme: dict[str, Any] | None) -> bool:
+    """Check if a theme should be replaced with base theme entirely"""
+    if theme is None or theme == {}:
+        return True
+
+    return False
+
+
+def _load_theme_from_model(
+    theme_model: Any | None, fallback_theme: dict[str, Any] | None, 
theme_type: str
+) -> dict[str, Any] | None:

Review Comment:
   Sure! I'll change this



##########
superset/daos/theme.py:
##########
@@ -47,25 +47,20 @@ def find_system_default(cls) -> Optional[Theme]:
 
         if len(system_defaults) > 1:
             logger.warning(
-                "Multiple system default themes found (%s), "
-                "falling back to config theme",
+                "Multiple system default themes found (%s), none will be used",
                 len(system_defaults),
             )
+            return None

Review Comment:
   Agree!



##########
superset/daos/theme.py:
##########
@@ -76,13 +71,10 @@ def find_system_dark(cls) -> Optional[Theme]:
 
         if len(system_darks) > 1:
             logger.warning(
-                "Multiple system dark themes found (%s), falling back to 
config theme",
+                "Multiple system dark themes found (%s), none will be used",
                 len(system_darks),
             )
+            return None

Review Comment:
   Agree as well!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to