Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit f7bd714b authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

add the dump_email management command

parent 52d54cd3
Pipeline #140250 failed with stages
in 2 seconds
from django.core.management.base import BaseCommand
from main.models import User
class Command(BaseCommand):
help = "Dump user emails"
def add_arguments(self, parser):
grp = parser.add_mutually_exclusive_group()
grp.add_argument("--provider", action="store_true",
help="select only the users who are allowed to create an app")
grp.add_argument("--guest", action="store_true",
help="select only the users who are not allowed to create an app")
def handle(self, *, provider, guest, **kw):
if provider:
pred = lambda u: u.is_provider
elif guest:
pred = lambda u: not u.is_provider
pred = lambda u: True
print("\n".join(u.email for u in filter(pred, User.objects.order_by("email"))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment