summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/entity_helpers.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-19 16:38:56 -0800
committerBryan Newbold <bnewbold@robocracy.org>2021-11-19 16:45:02 -0800
commitf22c278a96f46bf72d94db47fdd0efed6b61abf5 (patch)
tree340ea57d9d43e4685d097475cd695703cf9937d0 /python/fatcat_web/entity_helpers.py
parent046ecc62ba7a60a896200895be0b34b65ac72464 (diff)
downloadfatcat-f22c278a96f46bf72d94db47fdd0efed6b61abf5.tar.gz
fatcat-f22c278a96f46bf72d94db47fdd0efed6b61abf5.zip
web editgroup diff: don't enrich in TOML diff; fix overlapping break
Diffstat (limited to 'python/fatcat_web/entity_helpers.py')
-rw-r--r--python/fatcat_web/entity_helpers.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py
index 9657e828..34a5ceb9 100644
--- a/python/fatcat_web/entity_helpers.py
+++ b/python/fatcat_web/entity_helpers.py
@@ -305,14 +305,16 @@ def _entity_edit_diff(entity_type: str, entity_edit: EntityEdit) -> List[str]:
prev_revision
redirect_ident
"""
- pop_fields = ["revision", "state"]
- new_rev = generic_get_entity_revision(entity_type, entity_edit.revision)
- new_toml = entity_to_toml(new_rev, pop_fields=pop_fields).split("\n")
+ pop_fields = ["ident", "revision", "state"]
+ new_rev = generic_get_entity_revision(entity_type, entity_edit.revision, enrich=False)
+ new_toml = entity_to_toml(new_rev, pop_fields=pop_fields).strip().split("\n")
if len(new_toml) == 1 and not new_toml[0].strip():
new_toml = []
if entity_edit.prev_revision:
- old_rev = generic_get_entity_revision(entity_type, entity_edit.prev_revision)
- old_toml = entity_to_toml(old_rev, pop_fields=pop_fields).split("\n")
+ old_rev = generic_get_entity_revision(
+ entity_type, entity_edit.prev_revision, enrich=False
+ )
+ old_toml = entity_to_toml(old_rev, pop_fields=pop_fields).strip().split("\n")
fromdesc = f"/{entity_type}/rev/{entity_edit.prev_revision}.toml"
else:
old_toml = []