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)
def simple_algo(cls, all_conflict_orders, all_rooms, date, start_time, end_time): index_room = 0 already_scheduled = [] for order in all_conflict_orders: order_id = order.get_id() participents_order = order.get_participents() index_room = Room.get_next_room_from_list(all_rooms, index_room, len(participents_order), date, start_time, end_time) if index_room == -1: cls.remove_conflict_schedule(already_scheduled, date, start_time, end_time) return False, "There is no room" room = all_rooms[index_room] room_id = room.get_id_room() Schedule.assign_all(date, participents_order, start_time, end_time, order_id, room_id) scheds_by_order = Schedule.get_by_order(order_id) already_scheduled.append(scheds_by_order[0]) return True, room_id