[ckan-changes] [okfn/ckan] 85937a: [multilingual] fix errors in multilingual extensti...
GitHub
noreply at github.com
Fri Apr 27 15:28:13 UTC 2012
Branch: refs/heads/master
Home: https://github.com/okfn/ckan
Commit: 85937a78539d009367b283abb7394626a57d9aae
https://github.com/okfn/ckan/commit/85937a78539d009367b283abb7394626a57d9aae
Author: kindly <kindly at gmail.com>
Date: 2012-04-27 (Fri, 27 Apr 2012)
Changed paths:
M ckan/logic/converters.py
M ckanext/multilingual/plugin.py
Log Message:
-----------
[multilingual] fix errors in multilingual extenstion
diff --git a/ckan/logic/converters.py b/ckan/logic/converters.py
index 6b927ae..18a67df 100644
--- a/ckan/logic/converters.py
+++ b/ckan/logic/converters.py
@@ -77,7 +77,8 @@ def callable(key, data, errors, context):
for k in data.keys():
if k[0] == 'tags':
if data[k].get('vocabulary_id') == v.id:
- tags.append(data[k]['name'])
+ name = data[k].get('display_name', data[k]['name'])
+ tags.append(name)
data[key] = tags
return callable
diff --git a/ckanext/multilingual/plugin.py b/ckanext/multilingual/plugin.py
index a4696bd..c050f57 100644
--- a/ckanext/multilingual/plugin.py
+++ b/ckanext/multilingual/plugin.py
@@ -75,7 +75,7 @@ def translate_data_dict(data_dict):
translated_flattened[key] = fallback_translations.get(
value, value)
- elif isinstance(value, int):
+ elif isinstance(value, (int, dict)):
translated_flattened[key] = value
else:
================================================================
More information about the ckan-changes
mailing list