diff MoinMoin/themes/__init__.py @ 105:ddc707d70d9d

merged MattMaker's changes
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 12 Mar 2011 14:14:22 +0100
parents c084c1369078 9ca492c52070
children 5144c90c6bd8
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Fri Mar 11 13:17:05 2011 +0100
+++ b/MoinMoin/themes/__init__.py	Sat Mar 12 14:14:22 2011 +0100
@@ -31,7 +31,13 @@
         theme_name = u.theme_name
     else:
         theme_name = app.cfg.theme_default
-    return get_theme(theme_name)
+    try:
+        return get_theme(theme_name)
+    except KeyError:
+        logging.warning("theme %s was not found; using default of %s instead." % (theme_name, app.cfg.theme_default))
+        theme_name = app.cfg.theme_default
+        return get_theme(theme_name)
+
 
 
 def render_template(template, **context):