changeset 866:782ba105f5c7

reverted changeset f024fc5744d0 (there is already a default value)
author Goffi <goffi@goffi.org>
date Wed, 24 Feb 2016 12:09:28 +0100
parents f024fc5744d0
children 12d0e7bd0dd1
files src/server/server.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/server/server.py	Mon Feb 22 12:06:35 2016 +0100
+++ b/src/server/server.py	Wed Feb 24 12:09:28 2016 +0100
@@ -121,10 +121,10 @@
 
         ## redirections
         self.redirections = {}
-        if options.get('url_redirections_dict') is not None and not options['url_redirections_profile']:
+        if options['url_redirections_dict'] and not options['url_redirections_profile']:
             raise ValueError(u"url_redirections_profile need to be filled if you want to use url_redirections_dict")
 
-        for old, new in options.get('url_redirections_dict', {}).iteritems():
+        for old, new in options['url_redirections_dict'].iteritems():
             if not old.strip():
                 # root URL special case
                 old = ''
@@ -159,8 +159,8 @@
             self.redirections[old] = request_data
             if not old:
                 log.info(u"Root URL redirected to {uri}".format(uri=request_data[1].decode('utf-8')))
-        options.pop('url_redirections_dict', None)
-        options.pop('url_redirections_profile', None)
+        del options['url_redirections_dict']
+        del options['url_redirections_profile']
 
         if not '' in self.redirections:
             self.redirections[''] = self._getRequestData(C.LIBERVIA_MAIN_PAGE)