Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't seem to work anymore? #69

Open
tryformy opened this issue Feb 3, 2020 · 3 comments
Open

Doesn't seem to work anymore? #69

tryformy opened this issue Feb 3, 2020 · 3 comments

Comments

@tryformy
Copy link

tryformy commented Feb 3, 2020

The API wrapped seems to no longer be in use, any update?

@adhvaithr
Copy link

It's still fine, @tryformy. People still use it.

@HunterG6700
Copy link

It doesnt work for me I get this error when doing menu = store.get_menu
Exception has occurred: Exception
PRODUCT NOT FOUND: 9216 CouponPizza
File "D:\footb\Documents\Side Projects\Python pizza project\main.py", line 15, in
menu = store.get_menu()

@smonroe6
Copy link

smonroe6 commented May 4, 2022

The following work around seems to do the trick.

Inside of menu.py - comment out line 66 and add a continue statement when the conditional is triggered:

def build_categories(self, category_data, parent=None):
category = MenuCategory(category_data, parent)
for subcategory in category_data['Categories']:
new_subcategory = self.build_categories(subcategory, category)
category.subcategories.append(new_subcategory)
for product_code in category_data['Products']:
if product_code not in self.menu_by_code:
# raise Exception('PRODUCT NOT FOUND: %s %s' % (product_code, category.code))
continue
product = self.menu_by_code[product_code]
category.products.append(product)
product.categories.append(category)
return category

Instead of raising an exception when a product category is not found, it will just skip adding that product category and continue building.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants