def activate(self): """Activate the user""" audit('activate user', self.username) self.status = 'A' self.updated_by = zoom.system.user.user_id self.updated = zoom.tools.now() self.save()
def before_delete(self, user): """Things to do immediately before deleting a user""" user.remove_groups() audit('delete user', user.username)
def after_insert(self, user): """Things to do immediately after inserting a new user""" user.remove_groups() # avoid accidental authourizations user.add_group('users') audit('create user', user.username)
def after_update(self, user): """Things to do immediately after a user update""" audit('update user', user.username)