Revision e7cb4085 snf-astakos-app/astakos/im/management/commands/user-list.py

b/snf-astakos-app/astakos/im/management/commands/user-list.py
56 56
        'id': ('id', ('The id of the user')),
57 57
        'real name': ('realname', 'The name of the user'),
58 58
        'active': ('is_active', 'Whether the user is active or not'),
59
        'verified':
60
        ('email_verified', 'Whether the user has a verified email address'),
61
        'moderated':
62
        ('moderated', 'Account moderated'),
59 63
        'admin': ('is_superuser', 'Whether the user is admin or not'),
60 64
        'uuid': ('uuid', 'The uuid of the user'),
61 65
        'providers': (get_providers,
......
66 70
        'groups': (get_groups, 'The groups of the user')
67 71
    }
68 72

  
69
    fields = ['id', 'real name', 'active', 'admin', 'uuid']
73
    fields = ['id', 'real name', 'active', 'verified', 'moderated', 'admin',
74
              'uuid']
70 75

  
71 76
    option_list = ListCommand.option_list + (
72 77
        make_option('-p',
......
94 99
                    dest='active',
95 100
                    default=False,
96 101
                    help="Display only active users"),
102
        make_option('--pending-moderation',
103
                    action='store_true',
104
                    dest='pending_moderation',
105
                    default=False,
106
                    help="Display unmoderated users"),
107
        make_option('--pending-verification',
108
                    action='store_true',
109
                    dest='pending_verification',
110
                    default=False,
111
                    help="Display unverified users"),
97 112
        make_option("--displayname",
98 113
                    dest="displayname",
99 114
                    action="store_true",
......
112 127
        if options['active']:
113 128
            self.filters['is_active'] = True
114 129

  
130
        if options['pending_moderation']:
131
            self.filters['email_verified'] = True
132
            self.filters['moderated'] = False
133

  
134
        if options['pending_verification']:
135
            self.filters['email_verified'] = False
136

  
115 137
        if options['auth_providers']:
116 138
            self.fields.extend(['providers'])
117 139

  

Also available in: Unified diff