Commit 2dd8e7b9 authored by Vilem Ded's avatar Vilem Ded
Browse files

fix: export json contains current JSON schema

parent 7c23e7a6
......@@ -5,6 +5,9 @@ from core.models import Dataset
from core.utils import DaisyLogger
from django.conf import settings
from io import StringIO
from urllib.parse import urljoin
JSONSCHEMA_BASE_REMOTE_URL = getattr(settings, 'IMPORT_JSON_SCHEMAS_URI')
logger = DaisyLogger(__name__)
......@@ -69,7 +72,7 @@ class DatasetsExporter:
logger.debug(f' "{dataset_repr}" is not published, it can not be exported')
json.dump({
"$schema": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/master/schemas/elu-dataset.json",
"$schema": urljoin(JSONSCHEMA_BASE_REMOTE_URL, 'elu-dataset.json'),
"items": dataset_dicts}, buffer, indent=4)
return buffer
......@@ -5,6 +5,9 @@ from core.models import Partner
from core.utils import DaisyLogger
from django.conf import settings
from io import StringIO
from urllib.parse import urljoin
JSONSCHEMA_BASE_REMOTE_URL = getattr(settings, 'IMPORT_JSON_SCHEMAS_URI')
logger = DaisyLogger(__name__)
......@@ -54,7 +57,7 @@ class PartnersExporter:
else:
logger.debug(f' "{partner.name}" is not published, it can not be exported')
json.dump({
"$schema": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/master/schemas/elu-institution.json",
"$schema": urljoin(JSONSCHEMA_BASE_REMOTE_URL, 'elu-institution.json'),
"items": partner_dicts}, buffer , indent=4)
return buffer
......
......@@ -5,6 +5,9 @@ from core.models import Project
from core.utils import DaisyLogger
from django.conf import settings
from io import StringIO
from urllib.parse import urljoin
JSONSCHEMA_BASE_REMOTE_URL = getattr(settings, 'IMPORT_JSON_SCHEMAS_URI')
logger = DaisyLogger(__name__)
......@@ -72,7 +75,7 @@ class ProjectsExporter:
else:
logger.debug(f' "{project.acronym}" is not published, it can not be exported')
json.dump({
"$schema": "https://raw.githubusercontent.com/elixir-luxembourg/json-schemas/master/schemas/elu-project.json",
"$schema": urljoin(JSONSCHEMA_BASE_REMOTE_URL, 'project.json'),
"items": project_dicts}, buffer , indent=4)
return buffer
......
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