fix(init_db): eliminada creacion de materias y datos muestra en init_db, solo cuentas de test y bump a v3.8.2
This commit is contained in:
@@ -270,43 +270,51 @@ class DashboardService:
|
||||
# Mapas de reservas por aula en cada período
|
||||
res_map_classroom_today: Dict[int, List[Reservation]] = {}
|
||||
for r in today_reservations_q:
|
||||
if r.classroom_id:
|
||||
res_map_classroom_today.setdefault(r.classroom_id, []).append(r)
|
||||
cid = getattr(r, 'classroom_id', None)
|
||||
if cid is not None:
|
||||
res_map_classroom_today.setdefault(int(cid), []).append(r)
|
||||
|
||||
res_map_classroom_tomorrow: Dict[int, List[Reservation]] = {}
|
||||
for r in tomorrow_reservations_q:
|
||||
if r.classroom_id:
|
||||
res_map_classroom_tomorrow.setdefault(r.classroom_id, []).append(r)
|
||||
cid = getattr(r, 'classroom_id', None)
|
||||
if cid is not None:
|
||||
res_map_classroom_tomorrow.setdefault(int(cid), []).append(r)
|
||||
|
||||
res_map_classroom_week: Dict[int, List[Reservation]] = {}
|
||||
for r in week_reservations_q:
|
||||
if r.classroom_id:
|
||||
res_map_classroom_week.setdefault(r.classroom_id, []).append(r)
|
||||
cid = getattr(r, 'classroom_id', None)
|
||||
if cid is not None:
|
||||
res_map_classroom_week.setdefault(int(cid), []).append(r)
|
||||
|
||||
res_map_classroom_month: Dict[int, List[Reservation]] = {}
|
||||
for r in month_reservations_q:
|
||||
if r.classroom_id:
|
||||
res_map_classroom_month.setdefault(r.classroom_id, []).append(r)
|
||||
cid = getattr(r, 'classroom_id', None)
|
||||
if cid is not None:
|
||||
res_map_classroom_month.setdefault(int(cid), []).append(r)
|
||||
|
||||
res_map_comm_today: Dict[int, List[Reservation]] = {}
|
||||
for r in today_reservations_q:
|
||||
if r.commission_id:
|
||||
res_map_comm_today.setdefault(r.commission_id, []).append(r)
|
||||
comm_id = getattr(r, 'commission_id', None)
|
||||
if comm_id is not None:
|
||||
res_map_comm_today.setdefault(int(comm_id), []).append(r)
|
||||
|
||||
res_map_comm_tomorrow: Dict[int, List[Reservation]] = {}
|
||||
for r in tomorrow_reservations_q:
|
||||
if r.commission_id:
|
||||
res_map_comm_tomorrow.setdefault(r.commission_id, []).append(r)
|
||||
comm_id = getattr(r, 'commission_id', None)
|
||||
if comm_id is not None:
|
||||
res_map_comm_tomorrow.setdefault(int(comm_id), []).append(r)
|
||||
|
||||
res_map_comm_week: Dict[int, List[Reservation]] = {}
|
||||
for r in week_reservations_q:
|
||||
if r.commission_id:
|
||||
res_map_comm_week.setdefault(r.commission_id, []).append(r)
|
||||
comm_id = getattr(r, 'commission_id', None)
|
||||
if comm_id is not None:
|
||||
res_map_comm_week.setdefault(int(comm_id), []).append(r)
|
||||
|
||||
res_map_comm_month: Dict[int, List[Reservation]] = {}
|
||||
for r in month_reservations_q:
|
||||
if r.commission_id:
|
||||
res_map_comm_month.setdefault(r.commission_id, []).append(r)
|
||||
comm_id = getattr(r, 'commission_id', None)
|
||||
if comm_id is not None:
|
||||
res_map_comm_month.setdefault(int(comm_id), []).append(r)
|
||||
|
||||
all_active_commissions = Commission.query.filter_by(active=True).all()
|
||||
total_active_commissions = len(all_active_commissions)
|
||||
|
||||
Reference in New Issue
Block a user