gestioCOF/mails_adherents.sh
2016-05-21 23:57:36 +02:00

12 lines
351 B
Bash
Executable file

#!/bin/sh
# Lecture de la base
request="SELECT email, username FROM auth_user LEFT JOIN gestioncof_cofprofile ON auth_user.id = gestioncof_cofprofile.user_id WHERE mailing_cof=1 AND is_cof = 1;"
echo $request | python manage.py dbshell | \
# Suppression de l'en-tête
tail -n +2 | \
# Suppression des adhérents sans adresse mail
grep -v -P "^\t"