From d15d5ec54c73e657370cc8d4d7e1c1e7e6f40af4 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 18 Oct 2021 17:44:54 +0200 Subject: Syndication - delete unused matches - display match result - add a field for associated type in match --- ishtar_common/admin.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'ishtar_common/admin.py') diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py index 39d7de021..59dc99f15 100644 --- a/ishtar_common/admin.py +++ b/ishtar_common/admin.py @@ -2183,7 +2183,38 @@ def update_types_from_source(modeladmin, request, queryset): return_url ) result = source.update_matches(content) - print(result) + if result.get("created", None): + messages.add_message( + request, + messages.INFO, + str(_(f"{result['created']} matches created")), + ) + if result.get("updated", None): + messages.add_message( + request, + messages.INFO, + str(_(f"{result['updated']} matches updated")), + ) + if result.get("deleted", None): + messages.add_message( + request, + messages.INFO, + str(_(f"{result['deleted']} matches deleted")), + ) + if result.get("search_model do not exist", None): + missing_search_models = ", ".join(result['search_model do not exist']) + messages.add_message( + request, + messages.INFO, + str(_(f"Theses search models have not been found: {missing_search_models}. Not the same Ishtar version?")), + ) + if result.get("type do not exist", None): + missing_types = ", ".join(result['type do not exist']) + messages.add_message( + request, + messages.INFO, + str(_(f"Theses types have not been found: {missing_types}. Not the same Ishtar version?")), + ) return response -- cgit v1.2.3