minor fixes keyword tree system
This commit is contained in:
@ -51,6 +51,7 @@ class Chowdown(Integration):
|
|||||||
recipe = Recipe.objects.create(name=title, created_by=self.request.user, internal=True, space=self.request.space)
|
recipe = Recipe.objects.create(name=title, created_by=self.request.user, internal=True, space=self.request.space)
|
||||||
|
|
||||||
for k in tags.split(','):
|
for k in tags.split(','):
|
||||||
|
print(f'adding keyword {k.strip()}')
|
||||||
keyword, created = Keyword.get_or_create(name=k.strip(), space=self.request.space)
|
keyword, created = Keyword.get_or_create(name=k.strip(), space=self.request.space)
|
||||||
recipe.keywords.add(keyword)
|
recipe.keywords.add(keyword)
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ class KeywordSerializer(UniqueFieldsMixin, serializers.ModelSerializer):
|
|||||||
# since multi select tags dont have id's
|
# since multi select tags dont have id's
|
||||||
# duplicate names might be routed to create
|
# duplicate names might be routed to create
|
||||||
validated_data['space'] = self.context['request'].space
|
validated_data['space'] = self.context['request'].space
|
||||||
obj = Keyword.get_or_create(**validated_data)
|
obj, created = Keyword.get_or_create(**validated_data)
|
||||||
return obj
|
return obj
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Reference in New Issue
Block a user