Skip to content

Commit

Permalink
Work on valid inscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
iranzo committed Nov 14, 2024
1 parent 40a4e86 commit 87d46d1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
9 changes: 6 additions & 3 deletions 3-actividades-con-huecos.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
horario = int(actividad["idNivell"])

if horario in {7, 8, 9, 10}:
users = common.readjson(filename=f"{myid}")
inscritos = common.readjson(filename=f"{myid}")
libres = int(actividad["maxPlaces"]) - len(inscritos)
usadas = 0
for inscrito in inscritos:
if inscrito["estat"] == "INSCRESTNOVA":
usadas = usadas + 1
libres = int(actividad["maxPlaces"]) - usadas
if libres > 0:
print(f'{nombre},{int(actividad["maxPlaces"])},{len(inscritos)},{libres}')
print(f'{nombre},{int(actividad["maxPlaces"])},{usadas},{libres}')
2 changes: 1 addition & 1 deletion 3-elimina-conflictohoras.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
actividadyusuarios[myid].append(colegiat)
inscripcion = inscrito["idInscripcio"]

if inscrito["estat"] != "INSCRESTANULADA":
if inscrito["estat"] == "INSCRESTNOVA":
if colegiat not in usuariosyactividad:
usuariosyactividad[colegiat] = []

Expand Down
3 changes: 2 additions & 1 deletion 3-listadowifiupv.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
users = common.readjson(filename=f"{myid}")

for user in users:
usersconclave.append(user["colegiat"]["idColegiat"])
if user["estat"] == "INSCRESTNOVA":
usersconclave.append(user["colegiat"]["idColegiat"])


print("Listado para politécnica")
Expand Down
2 changes: 1 addition & 1 deletion 3-sociosconflictohoras.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
colegiat = inscrito["colegiat"]["idColegiat"]
actividadyusuarios[myid].append(colegiat)

if inscrito["estat"] != "INSCRESTANULADA":
if inscrito["estat"] == "INSCRESTNOVA":
if colegiat not in usuariosyactividad:
usuariosyactividad[colegiat] = []

Expand Down

0 comments on commit 87d46d1

Please sign in to comment.