From 788a7394bc468d36fb3f92f4be42138c9e8c9be5 Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Tue, 10 Oct 2023 12:11:51 +0200 Subject: [PATCH] Modification for places (#2070) --- openatlas/display/base_display.py | 2 +- openatlas/display/display.py | 2 +- openatlas/views/changelog.py | 1 + tests/test_event.py | 5 ++++- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openatlas/display/base_display.py b/openatlas/display/base_display.py index 2c45cd518..69f48829d 100644 --- a/openatlas/display/base_display.py +++ b/openatlas/display/base_display.py @@ -378,7 +378,7 @@ def add_tabs(self) -> None: and current_user.settings['module_map_overlay']: self.tabs['file'].table.header.append(_('overlay')) - for link_ in entity.get_links('P67', inverse=True): + for link_ in entity.get_links(['P31', 'P67'], inverse=True): domain = link_.domain data = get_base_table_data(domain) if domain.class_.view == 'file': diff --git a/openatlas/display/display.py b/openatlas/display/display.py index 88f6236e8..89d12c486 100644 --- a/openatlas/display/display.py +++ b/openatlas/display/display.py @@ -152,7 +152,7 @@ class ModificationDisplay(EventsDisplay): def add_data(self) -> None: super().add_data() - self.data[_('artifact')] = \ + self.data[_('object')] = \ [link(entity) for entity in self.entity.get_linked_entities('P31')] diff --git a/openatlas/views/changelog.py b/openatlas/views/changelog.py index 561d609bf..2ca6a7953 100644 --- a/openatlas/views/changelog.py +++ b/openatlas/views/changelog.py @@ -18,6 +18,7 @@ def index_changelog() -> str: '7.17.0': ['TBA', { 'feature': { '2026': 'External reference systems for type hierarchies', + '2070': 'Modification (E11) for Place (E18)', '2083': 'API: List of images'}, 'fix': { '2078': 'API: CSV export not working' diff --git a/tests/test_event.py b/tests/test_event.py index 224c6463a..ce11a30a3 100644 --- a/tests/test_event.py +++ b/tests/test_event.py @@ -111,7 +111,10 @@ def test_event(self) -> None: rv = self.app.post( url_for('insert', class_='modification'), - data={'name': 'A modification event', 'artifact': artifact.id}) + data={ + 'name': 'A modification event', + 'artifact': artifact.id, + 'modified_place': residence.id}) modification_id = rv.location.split('/')[-1] rv = self.app.get(url_for('view', id_=modification_id))