Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

fix: bug failed to add recipe with new items #30

Merged
merged 1 commit into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/controller/shoppinglist/shoppinglist_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def addShoppinglistItemByName(args, id):
item = Item.find_by_name(shoppinglist.household_id, args['name'])
if not item:
item = Item.create_by_name(shoppinglist.household_id, args['name'])
# item.checkAuthorized()

con = ShoppinglistItems.find_by_ids(shoppinglist.id, item.id)
if not con:
Expand Down
4 changes: 2 additions & 2 deletions app/models/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def obj_to_export_dict(self) -> dict:
def save(self, keepDefault=False) -> Self:
if not keepDefault:
self.default = False
super().save()
return super().save()

@classmethod
def create_by_name(cls, household_id: int, name: str, default=False) -> Self:
def create_by_name(cls, household_id: int, name: str, default: bool = False) -> Self:
return cls(
name=name.strip(),
default=default,
Expand Down