Add a hack to add a frontend section if not present
[htsworkflow.git] / 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