pizzapi icon indicating copy to clipboard operation
pizzapi copied to clipboard

Doesn't seem to work anymore?

Open tryformy opened this issue 5 years ago • 3 comments

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

tryformy avatar Feb 03 '20 06:02 tryformy

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

adhvaithr avatar Jul 25 '20 16:07 adhvaithr

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()

hunter-goller avatar Aug 28 '21 22:08 hunter-goller

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.

smonroe6 avatar May 04 '22 22:05 smonroe6