mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-03 13:19:16 -05:00
fixed supermarket category creation
This commit is contained in:
@@ -337,7 +337,7 @@ class SupermarketCategorySerializer(UniqueFieldsMixin, WritableNestedModelSerial
|
||||
def create(self, validated_data):
|
||||
name = validated_data.pop('name').strip()
|
||||
space = validated_data.pop('space', self.context['request'].space)
|
||||
obj, created = SupermarketCategory.objects.get_or_create(name__iexact=name, space=space, defaults=validated_data)
|
||||
obj, created = SupermarketCategory.objects.get_or_create(name=name, space=space)
|
||||
return obj
|
||||
|
||||
def update(self, instance, validated_data):
|
||||
|
||||
Reference in New Issue
Block a user