# HG changeset patch # User Goffi # Date 1456312168 -3600 # Node ID 782ba105f5c7eb20c446032acd1cced3ac8caa6c # Parent f024fc5744d03b9c383d59164aa093851b114260 reverted changeset f024fc5744d0 (there is already a default value) diff -r f024fc5744d0 -r 782ba105f5c7 src/server/server.py --- 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)