diff MoinMoin/themes/__init__.py @ 104:9ca492c52070

use default theme if we cannot get the one that was requested (instead of crashing)
author MattMaker <trip@entropyreductionservices.com>
date Fri, 11 Mar 2011 23:08:35 -0600
parents 5b156d90317f
children ddc707d70d9d
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Wed Mar 02 03:22:09 2011 +0100
+++ b/MoinMoin/themes/__init__.py	Fri Mar 11 23:08:35 2011 -0600
@@ -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):