#7892 script/task to disable list users

v1.3.0
closed
sf-1 (616)
General
Heith Seewald
2015-08-20
2015-06-08
No

It would be useful to have a ScriptTask to disable a batch of users at once.

Discussion

  • Dave Brondsema

    Dave Brondsema - 2015-06-08
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2015-06-08

    db/7892

    To run:

    • 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 -
     
  • Heith Seewald - 2015-06-08

    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.

     
  • Heith Seewald - 2015-06-08
    • status: review --> in-progress
    • Reviewer: Heith Seewald
     
  • Dave Brondsema

    Dave Brondsema - 2015-06-09
    • status: in-progress --> review
     
  • Dave Brondsema

    Dave Brondsema - 2015-06-09

    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.

     
  • Heith Seewald - 2015-06-09
    • status: review --> closed
     
  • Heith Seewald - 2015-06-09

    Looks good Dave :)

     
  • Dave Brondsema

    Dave Brondsema - 2015-06-15
    • labels: sf-current, sf-1 --> sf-1
     
  • Igor Bondarenko - 2015-06-18
    • Milestone: unreleased --> asf_release_1.3.0
     

Log in to post a comment.