Skip to content

Commit

Permalink
Reemplaza un fallo genérico por una excepción más explícita sobre lo …
Browse files Browse the repository at this point in the history
…que está pasando.
  • Loading branch information
abenassi committed May 4, 2018
1 parent 9d63f9e commit c87b724
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pydatajson/ckan_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from datetime import time
from dateutil import parser, tz
from .helpers import title_to_name
from . import custom_exceptions as ce


def append_attribute_to_extra(package, dataset, attribute, serialize=False):
Expand Down Expand Up @@ -99,7 +100,10 @@ def _get_theme_label(catalog, theme):
try:
label = catalog.get_theme(identifier=theme)['label']
except:
label = catalog.get_theme(label=theme)['label']
try:
label = catalog.get_theme(label=theme)['label']
except:
raise ce.ThemeNonExistentError(theme)

label = re.sub(r'[^\wá-úÁ-ÚñÑ .-]+', '',
label, flags=re.UNICODE)
Expand Down

0 comments on commit c87b724

Please sign in to comment.