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

Commit

Permalink
fix: bug failed to add recipe with new items (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomBursch authored May 2, 2023
1 parent 60a617d commit 4fba436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
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

0 comments on commit 4fba436

Please sign in to comment.