diff --git a/util/disableabuser.py b/util/disableabuser.py index b8c724b8b..4547d2230 100644 --- a/util/disableabuser.py +++ b/util/disableabuser.py @@ -11,12 +11,12 @@ def disable_abusing_user(username, queue_name): if not username: raise Exception('Must enter a username') - user = model.user.get_user(username) + user = model.user.get_namespace_user(username) if user is None: - raise Exception('Unknown user %s' % username) + raise Exception('Unknown user or organization %s' % username) if not user.enabled: - print "NOTE: User %s is already disabled" % username + print "NOTE: Namespace %s is already disabled" % username queue_prefix = '%s/%s/%%' % (queue_name, username) existing_queue_item_count = (QueueItem @@ -75,7 +75,7 @@ def disable_abusing_user(username, queue_name): count_removed = dockerfile_build_queue.delete_namespaced_items(user.username) info = (username, len(triggers), count_removed) - print "User %s disabled, %s triggers deleted, %s queued builds removed" % info + print "Namespace %s disabled, %s triggers deleted, %s queued builds removed" % info parser = argparse.ArgumentParser(description='Disables a user abusing the build system')