- store_id = int(match.args()[1])
- item_id = int(match.args()[2])
- result = Data().assign_store(store_id, item_id)
- return [result]
+ item_id = int(match.args()[1])
+ store_id = int(match.args()[2])
+
+ if not isinstance(store_id, int):
+ store_id = None
+
+ Data().assign_store(item_id, store_id)
+
+ # Now print the list for the assigned store
+ items = Data().get_shopping_list(store_id)
+ results = ['Shopping List']
+ for item in items:
+ results.append(str(item))
+ return results