From f22c278a96f46bf72d94db47fdd0efed6b61abf5 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 19 Nov 2021 16:38:56 -0800 Subject: web editgroup diff: don't enrich in TOML diff; fix overlapping break --- python/fatcat_web/entity_helpers.py | 12 +++++++----- python/fatcat_web/templates/editgroup_diff.html | 1 + 2 files changed, 8 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 = [] diff --git a/python/fatcat_web/templates/editgroup_diff.html b/python/fatcat_web/templates/editgroup_diff.html index 4b32fbf5..ec5e4a82 100644 --- a/python/fatcat_web/templates/editgroup_diff.html +++ b/python/fatcat_web/templates/editgroup_diff.html @@ -13,6 +13,7 @@ {{ entity_macros.extra_metadata(edit.extra) }} {% endif %} {% if edit.revision and not edit.redirect_ident and edit.ident in diffs and diffs[edit.ident] != None %} +
{% for line in diffs[edit.ident] %} {% set line_space = false %} -- cgit v1.2.3