fix(v3.4.6): fix reservation cascade, remove calendar mocks, strip auto meet links, friendly dates, dynamic building floors and career filter

This commit is contained in:
2026-10-08 08:26:15 -03:00
parent 25039efdeb
commit 368dc71b14
23 changed files with 291 additions and 149 deletions
+15 -9
View File
@@ -269,6 +269,14 @@ class GoogleSheetsImporter:
elif h < 13:
record_shift = 'Mañana'
v_link_row = None
if len(row) > col_offset + 5:
for extra_c in row[col_offset + 5:]:
extra_clean = _clean(extra_c)
if any(x in extra_clean.lower() for x in ['http://', 'https://', 'zoom.us', 'meet.google.com', 'teams.microsoft.com']):
v_link_row = extra_clean
break
records.append({
'dia': sheet_name,
'codigo': codigo,
@@ -276,7 +284,8 @@ class GoogleSheetsImporter:
'aula': aula,
'carrera': carrera,
'horario': horario,
'turno': record_shift
'turno': record_shift,
'virtual_link': v_link_row
})
return records
@@ -852,13 +861,10 @@ class GoogleSheetsImporter:
if import_reservations and classroom and subject and commission and t_start and t_end:
is_room_virtual = bool(classroom.is_virtual or 'VIRTUAL' in (classroom.code or '').upper())
v_link = None
if is_room_virtual:
clean_subj = re.sub(r'[^a-zA-Z0-9]', '', subject.code or 'cls').lower()
clean_comm = re.sub(r'[^a-zA-Z0-9]', '', commission.code or 'c1').lower()
v_link = f"https://meet.google.com/edu-{clean_subj}-{clean_comm}"
if not commission.virtual_link:
commission.virtual_link = v_link
# Respetar estrictamente los datos del Sheet: si no hay enlace explícito en el documento, NO autogenerar ninguno
v_link = rec.get('virtual_link') or None
if v_link and not commission.virtual_link:
commission.virtual_link = v_link
# Determinar fechas a generar: específica de la fila (datepicker), puntual o 16 semanas
dates_to_generate = []
@@ -921,7 +927,7 @@ class GoogleSheetsImporter:
else:
existing_res.shift = turno
existing_res.notes = note_text
if is_room_virtual and not existing_res.virtual_link:
if v_link:
existing_res.virtual_link = v_link
if len(stats['sample_records']) < 15: