(self, username)
Sets the active bit of a user to false.
Sets the active bit of a user to false.
Sets the active bit of a user to false .
def run(self, username):
        """Sets the active bit of a user to false."""
        user = User.query.filter_by(username=username).first()

        if not user:
            sys.stdout.write('User [{0:s}] does not exist.\n'.format(
                username))
            return
        user.active = False
        db_session.add(user)
        db_session.commit()

        sys.stdout.write('User {0:s} is deactivated.\n'.format(username))
def run ( self , username ) : user = User . query . filter_by ( username = username ) . first ( ) if not user : sys . stdout . write ( 'User [{0:s}] does not exist.\n' . format ( username ) ) return user . active = False db_session . add ( user ) db_session . commit ( ) sys . stdout . write ( 'User {0:s} is deactivated.\n' . format ( username ) )