Commit 7af8c493 authored by Christophe Benz's avatar Christophe Benz

Follow opendataschema evolutions

parent 04f1214f
Pipeline #1085 passed with stage
in 4 minutes and 54 seconds
......@@ -5,7 +5,7 @@ ezodf==0.3.2
Flask==1.0.2
Flask-Matomo==1.2.0
lxml==4.2.5
opendataschema==0.4.1
opendataschema==0.5.0
python-dotenv==0.10.1
requests==2.22.0
toml==0.10.0
......
......@@ -64,7 +64,7 @@ setup(
'tabulator',
'opendataschema >= 0.4.1, < 0.5',
'opendataschema >= 0.5.0, < 0.6',
'validata_core >= 0.3.0, < 0.4',
],
......
......@@ -80,13 +80,13 @@ class SchemaInstance:
abort(400, "Schéma '{}' non trouvé dans le catalogue de la section '{}'".format(self.name, self.section_name))
if isinstance(schema_reference, GitSchemaReference):
self.tags = sorted(schema_reference.iter_tags(), key=by_semver, reverse=True)
if self.ref is None:
schema_ref = schema_reference.get_latest_tag() or schema_reference.get_default_branch()
schema_ref = self.tags[0] if self.tags else schema_reference.get_default_branch()
abort(redirect(compute_validation_form_url({
'schema_name': self.schema_and_section_name,
'schema_ref': schema_ref.name
})))
self.tags = sorted(schema_reference.iter_tags(), key=by_semver, reverse=True)
tag_names = [tag.name for tag in self.tags]
self.branches = [branch for branch in schema_reference.iter_branches()
if branch.name not in tag_names]
......
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