1.2.5.3 Disabling Accounts using active

Occasionally it is useful to disable a user, say for example if they haven't renewed their subscription. You don't want to completely remove their accound since you would have to add all the information if they paid the fee, you just want to disable the account.

This can be achieved by setting a user's active property. Here are some ways of setting the active property:

admin.addUser(username='vicki', group='butcher', password='password', active=0)
admin.user('james').active = 0

The default value of the active parameter of the authorise() method if 1 so once active is set to 0, the user will not be authorised unless active is specified as 0 to mean only authorise disabled accounts ot None to mean authorise all accounts.

>>> admin.user('james').authorise()
0
>>> admin.user('james').authorise(active=0)
1