fix(recipe models): 修复通过嘟嘟创建菜谱时没有设置 status 导致创建失败的问题

修复通过嘟嘟创建菜谱时没有设置 status 导致创建失败的问题

Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
Ching 2022-02-10 22:38:12 +08:00
parent b26000205b
commit e7a579e168

View File

@ -55,7 +55,9 @@ class Recipe(models.Model):
difficulty = 0
else:
difficulty = 0
recipe = cls.objects.create(name=name, recipe_type=recipe_type, rate=rate, difficulty=difficulty)
recipe = cls.objects.create(
name=name, recipe_type=recipe_type, rate=rate, difficulty=difficulty, status=const.RECIPE_STATUS_ACTIVE
)
return recipe
@property