From 601004fec1a4c3f1f93a367ae2a2f2ef9c2881b8 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 745c37a78..190caad73 100644 --- a/cookbook/helper/recipe_search.py +++ b/cookbook/helper/recipe_search.py @@ -115,7 +115,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):