[ckan-changes] [okfn/ckan] ae5ad3: [multilingual] fix errors in multilingual extensti...

GitHub noreply at github.com
Fri Apr 27 13:10:41 UTC 2012


  Branch: refs/heads/release-v1.7
  Home:   https://github.com/okfn/ckan
  Commit: ae5ad352a66e60fa455203d71730e811fcf0d883
      https://github.com/okfn/ckan/commit/ae5ad352a66e60fa455203d71730e811fcf0d883
  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