def cancel_order(self, order_id): """ this method delete the order that match this order_id from the 'orders' table in db and delete the meeting from the schedule of each participant that invited to this meeting. only the user taht create this order can cancel it :param order_id: """ if Order.who_create_order(order_id) == self.email: Order.delete_order(order_id) Schedule.delete_order(order_id)
def cancel_meeting(self, meeting_id): """ this user won't come to this meeting so the user decide to cancel it :param meeting_id: """ order_id = Schedule.cancel_meeting(meeting_id) if Order.who_create_order(order_id) == self.email: return self.cancel_order(order_id) if order_id is not None: Order.participant_cancel(self.email, order_id) meetings = Schedule.get_by_order(order_id) for m in meetings: m.remove_participants(self.email)