Add a hack to add a frontend section if not present
authorDiane Trout <diane@caltech.edu>
Wed, 17 Jun 2009 19:25:34 +0000 (19:25 +0000)
committerDiane Trout <diane@caltech.edu>
Wed, 17 Jun 2009 19:25:34 +0000 (19:25 +0000)
This will allow the django test code to run on systems that aren't
setup to run the web site.

htsworkflow/frontend/settings.py

index d971bbcbe004fe97ce839fa7d0a85089cd7deee0..42d091adb9939421344b03e209b4ffac3ff9323c 100644 (file)
@@ -61,6 +61,12 @@ options = ConfigParser.SafeConfigParser(
 options.read([os.path.expanduser("~/.htsworkflow.ini"),
               '/etc/htsworkflow.ini',])
 
+# OptionParser will use the dictionary passed into the config parser as
+# 'Default' values in any section. However it still needs an empty section
+# to exist in order to retrieve anything.
+if not options.has_section('frontend'):
+    options.add_section('frontend')
+
 # Django settings for elandifier project.
 
 DEBUG = True