From a00055ac6e8b1f0199d7440dee96f54c89e8c520 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Wed, 30 Jun 2021 16:17:46 +0200 Subject: [PATCH] partially working --- cookbook/helper/recipe_search.py | 2 +- cookbook/integration/integration.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cookbook/helper/recipe_search.py b/cookbook/helper/recipe_search.py index f798cd529..a44b6b210 100644 --- a/cookbook/helper/recipe_search.py +++ b/cookbook/helper/recipe_search.py @@ -114,7 +114,7 @@ def search_recipes(request, queryset, params): ) queryset = queryset.filter(query_filter).annotate(rank=search_rank) else: - queryset = queryset.filter(query_filter) + queryset = queryset.filter(name__icontains=search_string) if len(search_keywords) > 0: if search_keywords_or == 'true': diff --git a/cookbook/integration/integration.py b/cookbook/integration/integration.py index b7ee9f29d..2a37da598 100644 --- a/cookbook/integration/integration.py +++ b/cookbook/integration/integration.py @@ -31,11 +31,12 @@ class Integration: """ self.request = request self.export_type = export_type - self.keyword = Keyword.objects.create( + # TODO add all import keywords under the importer root node + self.keyword = Keyword.add_root( name=f'Import {export_type} {date_format(datetime.datetime.now(), "DATETIME_FORMAT")}.{datetime.datetime.now().strftime("%S")}', description=f'Imported by {request.user.get_user_name()} at {date_format(datetime.datetime.now(), "DATETIME_FORMAT")}. Type: {export_type}', icon='📥', - space=request.space + space=request.space, ) def do_export(self, recipes):