forked from jan/debianmemberportfolio
support non unicode fields
This commit is contained in:
parent
ce83914398
commit
cce0d82f56
1 changed files with 10 additions and 3 deletions
|
@ -50,9 +50,16 @@ def build_urls(fields):
|
||||||
"""Build personalized URLs using the developer information in
|
"""Build personalized URLs using the developer information in
|
||||||
fields."""
|
fields."""
|
||||||
data = []
|
data = []
|
||||||
qfields = dict([(key, quote_plus(fields[key].encode('utf8'))) \
|
qfields = {}
|
||||||
for key in fields \
|
for key, value in fields.iteritems():
|
||||||
if fields[key] is not None and isinstance(fields[key], unicode)])
|
if value is not None:
|
||||||
|
if isinstance(value, unicode):
|
||||||
|
qfields[key] = quote_plus(value.encode('utf8'))
|
||||||
|
elif isinstance(value, str):
|
||||||
|
qfields[key] = quote_plus(value)
|
||||||
|
else:
|
||||||
|
qfields[key] = value
|
||||||
|
|
||||||
if 'gpgfp' not in qfields:
|
if 'gpgfp' not in qfields:
|
||||||
fpr = keyfinder.getFingerprintByEmail(fields['email'].encode('utf8'))
|
fpr = keyfinder.getFingerprintByEmail(fields['email'].encode('utf8'))
|
||||||
if fpr:
|
if fpr:
|
||||||
|
|
Loading…
Reference in a new issue