Revision 751d24cf snf-astakos-app/astakos/im/management/commands/listusers.py

b/snf-astakos-app/astakos/im/management/commands/listusers.py
54 54
            dest='pending',
55 55
            default=False,
56 56
            help="List only users pending activation"),
57
        make_option('-n',
58
            action='store_true',
59
            dest='pending_send_mail',
60
            default=False,
61
            help="List only users who have not received activation"),
57 62
        )
58 63
    
59 64
    def handle(self, *args, **options):
......
63 68
        users = AstakosUser.objects.all()
64 69
        if options['pending']:
65 70
            users = users.filter(is_active=False)
71
        elif options['pending_send_mail']:
72
            users = users.filter(is_active=False, activation_sent=None)
66 73
        
67 74
        labels = ('id', 'email', 'real name', 'active', 'admin', 'provider', 'groups')
68
        columns = (3, 24, 24, 6, 5, 12,  24)
75
        columns = (3, 24, 24, 6, 5, 12, 24)
69 76
        
70 77
        if not options['csv']:
71 78
            line = ' '.join(l.rjust(w) for l, w in zip(labels, columns))

Also available in: Unified diff