Commit 680ba615 authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

fix config model (usage)

parent a36fb4db
......@@ -12,6 +12,7 @@ import opendataschema
import pkg_resources
import requests
from commonmark import commonmark
from pydantic import HttpUrl
from . import config
......@@ -58,8 +59,8 @@ if config.CONFIG:
for section in config.CONFIG.homepage.sections:
name ='Initializing homepage section "{}"...'.format(name))
catalog_ref = section.catalog
if catalog_ref:
if section.catalog:
catalog_ref = section.catalog.__str__() if isinstance(section.catalog, HttpUrl) else section.catalog.dict()
schema_catalog_registry.add_ref(name, catalog_ref)"...done")
......@@ -20,7 +20,7 @@ class Schema(BaseModel):
repo_url: HttpUrl
class Catalog(BaseModel):
version: str
version: int
schemas: List[Schema]
class Section(BaseModel):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment