fixed NC importer importing empty keywords

This commit is contained in:
vabene1111
2022-04-18 12:52:20 +02:00
parent d1065c8ac4
commit 1100826ed8

View File

@ -40,7 +40,8 @@ class NextcloudCookbook(Integration):
if 'keywords' in recipe_json:
try:
for x in recipe_json['keywords'].split(','):
recipe.keywords.add(Keyword.objects.get_or_create(space=self.request.space, name=x)[0])
if x.strip() != '':
recipe.keywords.add(Keyword.objects.get_or_create(space=self.request.space, name=x)[0])
except Exception:
pass