-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3-listado-socios-conflicto-nosocio.py
executable file
·68 lines (54 loc) · 2.15 KB
/
3-listado-socios-conflicto-nosocio.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python
import common
print("Loading file from disk")
socios = common.readjson(filename="socios")
print("Procesando socios...")
idpasaportesociosconocidos = []
idsocioconocidos = []
sociospasaportes = {}
sociosnosocio = {}
# For each user check the custom fields that store the telegram ID for each tutor
for user in socios:
if (
"estat" in user
and user["estat"] == "COLESTVAL"
and "estatColegiat" in user
and user["estatColegiat"]["nom"] == "ESTALTA"
):
idcolegiat = user["idColegiat"]
idsocio = user["numColegiat"].lower()
idpasaporte = user["persona"]["residencia"].lower()
if idpasaporte == "":
idpasaporte = False
if idsocio == "":
idsocio = False
# Fill dictionary of card support media
if idpasaporte not in sociospasaportes:
sociospasaportes[idpasaporte] = []
if idpasaporte and idpasaporte != "":
sociospasaportes[idpasaporte].append(idcolegiat)
# Fill dictionary of associate number
if (
idpasaporte
and idpasaporte not in idpasaportesociosconocidos
and idpasaporte != ""
):
idpasaportesociosconocidos.append(idpasaporte)
elif idpasaporte and idpasaporte != "-":
print(
"Socio Pasaporte ID: %s duplicado: https://asociacionavast.playoffinformatica.com/FormAssociat.php?idColegiat=%s"
% (idpasaporte, idcolegiat)
)
print("Conflictos: %s" % sociospasaportes[idpasaporte])
if idsocio not in sociosnosocio:
sociosnosocio[idsocio] = []
if idsocio and idsocio != "":
sociosnosocio[idsocio].append(idcolegiat)
if idsocio and idsocio not in idsocioconocidos and idsocio != "":
idsocioconocidos.append(idsocio)
elif idsocio and idsocio != "-":
print(
"nº Socio ID: %s duplicado: https://asociacionavast.playoffinformatica.com/FormAssociat.php?idColegiat=%s"
% (idsocio, idcolegiat)
)
print("Conflictos: %s" % sociosnosocio[idsocio])