Skip to content

Commit

Permalink
Fix uuid handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Jul 31, 2024
1 parent 03f549f commit c7ab793
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions isimip_publisher/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ def __init__(self, dataset=None, name=None, path=None, abspath=None, specifiers=
self.checksum_type = get_checksum_type()
self.clean = False

self._uuid = None
self._size = None
self._checksum = None
self._netcdf_header = None

@cached_property
def uuid(self):
if self.netcdf_header:
Expand Down Expand Up @@ -97,7 +92,7 @@ def checksum(self):
@cached_property
def json(self):
return {
'id': self._uuid,
'id': self.uuid,
'path': self.path,
'size': self.size,
'checksum': self.checksum,
Expand Down
2 changes: 1 addition & 1 deletion isimip_publisher/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def check_datasets(datasets, db_datasets):

# check file uuid consitency
if file.uuid:
if str(file.uuid) != db_file.id:
if str(file.uuid) != str(db_file.id):
logger.error(f'UUID mismatch {file.uuid} != {db_file.id} for file {db_file.path}')

# check file specifiers consitency
Expand Down

0 comments on commit c7ab793

Please sign in to comment.