From 695b41630d6043396a9762b08bbbc024fa2d33ee Mon Sep 17 00:00:00 2001 From: Alexander Watzinger Date: Mon, 9 Dec 2024 16:53:51 +0100 Subject: [PATCH] Fixed sex estimate update --- openatlas/models/tools.py | 1 + tests/test_place.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openatlas/models/tools.py b/openatlas/models/tools.py index 3cef92ce6..f70e22103 100755 --- a/openatlas/models/tools.py +++ b/openatlas/models/tools.py @@ -244,6 +244,7 @@ def save( entity: Entity, data: dict[str, str], types: list[dict[str, Any]]) -> None: + from openatlas.models.entity import Link for dict_ in types: Link.delete_(dict_['link_id']) SexEstimation.prepare_feature_types() diff --git a/tests/test_place.py b/tests/test_place.py index 0406ea9ab..2d35315a6 100644 --- a/tests/test_place.py +++ b/tests/test_place.py @@ -295,13 +295,13 @@ def test_place(self) -> None: url_for('sex_update', id_=strati_id), data={'Glabella': 'Female'}, follow_redirects=True) - assert b'-2.0' in rv.data + assert b'Female' in rv.data rv = c.post( url_for('sex_update', id_=strati_id), - data={'Glabella': 'Female'}, + data={'Glabella': 'Female?'}, follow_redirects=True) - assert b'-2.0' in rv.data + assert b'Female?' in rv.data rv = c.get(url_for('sex_update', id_=strati_id)) assert b'Glabella' in rv.data