diff --git a/validata_ui/templates/home.html b/validata_ui/templates/home.html index 95d6d1bd83a6b0e5548d157f5fd994814b8db39b..a94f8ea0cb06a31fc8bf2d22badb263c711e4212 100644 --- a/validata_ui/templates/home.html +++ b/validata_ui/templates/home.html @@ -17,7 +17,8 @@ diff --git a/validata_ui/views.py b/validata_ui/views.py index 3f17c428f8b05f5be036c74fab92c224c9ca89a5..a4337cbd76e0a77a2893d2cf293bae9d1a87e85c 100644 --- a/validata_ui/views.py +++ b/validata_ui/views.py @@ -461,11 +461,17 @@ def home(): home_section_catalog = [] for schema_reference in schema_catalog.references: # Loads default table schema for each schema reference - table_schema = tableschema_from_url(schema_reference.get_schema_url()) - home_section_catalog.append({ - "name": schema_reference.name, - "title": table_schema.descriptor.get("title") or schema_reference.name, - }) + schema_info = { + 'name': schema_reference.name + } + try: + table_schema = tableschema_from_url(schema_reference.get_schema_url()) + except: + schema_info['err'] = True + schema_info['title'] = 'Schéma "{}" non disponible'.format(schema_reference.name) + else: + schema_info['title'] = table_schema.descriptor.get("title") or schema_reference.name + home_section_catalog.append(schema_info) home_section['catalog'] = sorted( home_section_catalog, key=lambda sc: strip_accents(sc['title'].lower()))