cotisation : correction noms avec apostrophes (corrige #3)

This commit is contained in:
Adrien Bourmault 2023-11-04 15:19:21 +01:00
parent 52ffe2505a
commit fe1398ac7a
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
1 changed files with 3 additions and 16 deletions

View File

@ -33,6 +33,7 @@ RECEPT_MAIL_ATTACHMENT="mail_recu_attachment.txt"
SUMMARY_MAIL="mail_recap_header.txt" SUMMARY_MAIL="mail_recap_header.txt"
SENDMAIL_LOCATION = "/usr/sbin/sendmail" # sendmail location SENDMAIL_LOCATION = "/usr/sbin/sendmail" # sendmail location
BUF=[] BUF=[]
GITEA_URL = "https://forge.a-lec.org"
# gestion_read("SELECT * FROM services_users su \ # gestion_read("SELECT * FROM services_users su \
# INNER JOIN membres m ON m.id = su.id_user \ # INNER JOIN membres m ON m.id = su.id_user \
@ -68,23 +69,9 @@ def gestion_read(req):
return response.json() return response.json()
def git_mail_ticket_read(req): def git_mail_ticket_read(req):
response = requests.get('https://git.a-lec.org/api/v4/projects/46/issues', response: requests.Response = requests.get('https://forge.a-lec.org/api/v1/repos/{}/{}/issues?access_token={}'.format("cominfra", "mail", git_get_secret()), params=req)
headers={'PRIVATE-TOKEN' : git_get_secret()},
params = req)
return response.json() return response.json()
def git_xmpp_ticket_create(req):
response = requests.post('https://git.a-lec.org/api/v4/projects/44/issues',
headers={'PRIVATE-TOKEN' : git_get_secret()},
data = req)
return response.json()
def gestion_adduser(req):
response = requests.put('https://gestion.a-lec.org/api/user/import',
auth = HTTPBasicAuth('api666', gestion_get_secret()),
data = req)
return response.content
def setup_workdir(): def setup_workdir():
if not os.path.isdir(WORKDIR): if not os.path.isdir(WORKDIR):
os.mkdir(WORKDIR) os.mkdir(WORKDIR)
@ -357,7 +344,7 @@ def validate(member):
date = datetime.datetime.strptime( date = datetime.datetime.strptime(
answer["date"],'%Y-%m-%d').strftime("%d/%m/%Y") answer["date"],'%Y-%m-%d').strftime("%d/%m/%Y")
filename = "{}_reçu_{}".format( filename = "{}_reçu_{}".format(
answer["nom"].replace(" ", "_"), answer["nom"].replace(" ", "_").replace("'", "_"),
date.replace("/", ".")) date.replace("/", "."))
BUF.append("* {} (numero {}), {}".format(answer["id"], BUF.append("* {} (numero {}), {}".format(answer["id"],