Skip to content

Commit

Permalink
Fix updating file size in extended metadata strategy
Browse files Browse the repository at this point in the history
Fixes #16106
  • Loading branch information
mvdbeek committed May 18, 2023
1 parent cf49d9e commit d8ff7a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3733,8 +3733,8 @@ def _serialize(self, id_encoder, serialization_options):
# serialize Dataset objects only for jobs that can actually modify these models.
assert serialization_options.serialize_dataset_objects

def to_int(n):
return int(n) if n is not None else 0
def to_int(n) -> Optional[int]:
return int(n) if n is not None else None

rval = dict_for(
self,
Expand Down
2 changes: 2 additions & 0 deletions lib/galaxy/model/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@ def handle_dataset_object_edit(dataset_instance, dataset_attrs):
file_name=source,
create=True,
)
# Don't trust serialized file size
dataset_instance.dataset.file_size = None
dataset_instance.dataset.set_total_size() # update the filesize record in the database

if dataset_instance.deleted:
Expand Down

0 comments on commit d8ff7a5

Please sign in to comment.