diff options
author | Pavel Zuna <pzuna@redhat.com> | 2010-12-22 15:18:33 -0500 |
---|---|---|
committer | Adam Young <ayoung@redhat.com> | 2010-12-22 11:00:10 -0500 |
commit | e5ccddf446c5f1ae22a29b67062372b6dfbd35d7 (patch) | |
tree | 473036f429b5e161446282c67b8968413a3a2569 /ipalib/parameters.py | |
parent | 671c0700501071603a1221143254395db8132a45 (diff) | |
download | freeipa-e5ccddf446c5f1ae22a29b67062372b6dfbd35d7.tar.gz freeipa-e5ccddf446c5f1ae22a29b67062372b6dfbd35d7.tar.xz freeipa-e5ccddf446c5f1ae22a29b67062372b6dfbd35d7.zip |
Fix webUI command parameters error on Fedora 14.
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r-- | ipalib/parameters.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index feccd7eaa..5c386c324 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -1014,7 +1014,7 @@ class Int(Number): """ if type(value) in (int, long): return value - if type(value) is unicode: + if type(value) in (str, unicode): # permit floating point strings if value.find(u'.') >= 0: try: @@ -1247,6 +1247,14 @@ class Str(Data): """ if type(value) is self.type: return value + if type(value) is str: + try: + return value.decode('utf-8') + except UnicodeDecodeError: + raise ConversionError( + name=self.name, index=index, + error=ugettext(self.scalar_error) + ) if type(value) in (int, float): return self.type(value) if type(value) in (tuple, list): |