Skip to content

Commit

Permalink
versions: dump UUIDs as string
Browse files Browse the repository at this point in the history
* dump the UUIDs for `latest_id` and `next_draft_id` as string, if they
  are not `None`
* otherwise, the results may not be manageable for further processing
  (e.g. `json.dumps(...)`)
  • Loading branch information
max-moser committed May 13, 2024
1 parent 5a89473 commit d87b757
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions invenio_drafts_resources/records/systemfields/versions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021-2023 CERN.
# Copyright (C) 2024 TU Wien.
#
# Invenio-Drafts-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
Expand Down Expand Up @@ -148,9 +149,9 @@ def set_latest(self):
def dump(self):
"""Dump the versions state to the index."""
return dict(
latest_id=self.latest_id,
latest_id=str(self.latest_id) if self.latest_id else None,
latest_index=self.latest_index,
next_draft_id=self.next_draft_id,
next_draft_id=str(self.next_draft_id) if self.next_draft_id else None,
is_latest=self.is_latest,
is_latest_draft=self.is_latest_draft,
index=self.index,
Expand Down

0 comments on commit d87b757

Please sign in to comment.