Permalink
Browse files

Encode option keys for use as kwargs

  • Loading branch information...
1 parent b60cd85 commit d3c14ac2998ea172f0a1de5282d9f40b72821231 @parente committed Dec 12, 2010
Showing with 5 additions and 1 deletion.
  1. +5 −1 hbag/admin/admin.py
View
@@ -26,5 +26,9 @@ def post(self, *args, **kwargs):
for name, info in obj.iteritems():
enabled = info['enabled']
options = json.loads(info['options'])
+ optionsEnc = {}
+ for key, value in options.iteritems():
+ # encode keys to avoid problems passing by kwarg
+ optionsEnc[key.encode('utf-8')] = value
# @todo: keys can't be unicode, passed around as kwargs everywhere
- self.application.set_handler_status(name, enabled, options)
+ self.application.set_handler_status(name, enabled, optionsEnc)

0 comments on commit d3c14ac

Please sign in to comment.