Revision 61b9822f

b/snf-astakos-app/astakos/im/management/commands/modifyuser.py
66 66
            dest='noadmin',
67 67
            default=False,
68 68
            help="Revoke user's admin rights"),
69
        make_option('--inactive',
69
        make_option('--set-active',
70
            action='store_true',
71
            dest='active',
72
            default=False,
73
            help="Change user's state to inactive"),
74
        make_option('--set-inactive',
70 75
            action='store_true',
71 76
            dest='inactive',
72 77
            default=False,
......
86 91
        elif options.get('noadmin'):
87 92
            user.is_superuser = False
88 93
        
94
        if options.get('active'):
95
            user.is_active = True
96
        elif options.get('inactive'):
97
            user.is_active = False
98
        
89 99
        invitations = options.get('invitations')
90 100
        if invitations is not None:
91 101
            user.invitations = int(invitations)
......
97 107
        if options['renew_token']:
98 108
            user.renew_token()
99 109
        
100
        if options.get('inactive'):
101
            user.is_active = False
102
        user.save()
110
        user.save()

Also available in: Unified diff