It would be useful to have a ScriptTask to disable a batch of users at once.
paster script development.ini allura/scripts/disable_users.py -- --usernames user03 user04 user05
cat users.txt | paster script development.ini allura/scripts/disable_users.py -- --usernames -
Looking good -- but we may want to only get the users that are actually enabled (in case it's ran twice or something).
user = M.User.query.get(username=username, disabled=False)
May need to update the log message as well.
Sure, done. I used an attribute check instead of making it part of the query since the 'disabled' field hasn't always been there so there are older mongo records that don't have it in there. But Ming will default the attribute for you once the record is loaded.
Looks good Dave :)
Log in to post a comment.