show button to update schema in model instance only if the schema is different
@@ -2,6 +2,7 @@ import json
import os
import jsonschema
+from deepdiff import DeepDiff
from django.contrib.postgres.fields import JSONField
from django.core.exceptions import PermissionDenied
from django.db import models
@@ -182,6 +183,7 @@ class ModelInstanceFileMetaData(GenericFileMetaDataMixin):
"metadata in this model instance.",
cls="alert alert-danger", id="div-invalid-schema-message")
if self.executed_by and self.executed_by.metadata_schema_json:
+ if DeepDiff(self.logical_file.metadata_schema_json, self.executed_by.metadata_schema_json):
schema_update_url = "/hsapi/_internal/{}/update-modelinstance-meta-schema/"
schema_update_url = schema_update_url.format(self.logical_file.id)
if invalid_schema:
