Skip to content

Commit

Permalink
Error Interno
Browse files Browse the repository at this point in the history
  • Loading branch information
germankay committed Jan 3, 2025
1 parent 77414f7 commit 70231f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 19 additions & 0 deletions ckanext-unckan/ckanext/unckan/helpers/datastore.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import logging
from ckan.plugins.toolkit import chained_helper


log = logging.getLogger(__name__)


@chained_helper
def sanitize_id(original_fn, id):
""" Sobreescribimos el helper del datastore para evitar errores
original: return str(uuid.UUID(id_))
"""
try:
new_id = original_fn(id)
except Exception:
log.critical(f"Error sanitize_id in helpers datastore id:{id}")
raise

return new_id
3 changes: 2 additions & 1 deletion ckanext-unckan/ckanext/unckan/plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from ckan import plugins
from ckan.plugins import toolkit
from ckanext.unckan.helpers import base
from ckanext.unckan.helpers import base, datastore


log = logging.getLogger(__name__)
Expand All @@ -23,4 +23,5 @@ def update_config(self, config_):
def get_helpers(self):
return {
'get_unckan_version': base.get_unckan_version,
'sanitize_id': datastore.sanitize_id,
}

0 comments on commit 70231f4

Please sign in to comment.