ruff: Fix N818 exception name should be named with an Error suffix.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2022-11-17 00:30:48 -08:00
committed by Tim Abbott
parent eb2c822d3f
commit 73c4da7974
110 changed files with 507 additions and 507 deletions

View File

@@ -21,8 +21,8 @@ from zerver.lib.cache import (
)
from zerver.lib.exceptions import (
JsonableError,
OrganizationAdministratorRequired,
OrganizationOwnerRequired,
OrganizationAdministratorRequiredError,
OrganizationOwnerRequiredError,
)
from zerver.lib.timezone import canonicalize_timezone
from zerver.lib.types import ProfileDataElementUpdateDict, ProfileDataElementValue
@@ -145,12 +145,12 @@ def check_bot_creation_policy(user_profile: UserProfile, bot_type: int) -> None:
if user_profile.realm.bot_creation_policy == Realm.BOT_CREATION_EVERYONE:
return
if user_profile.realm.bot_creation_policy == Realm.BOT_CREATION_ADMINS_ONLY:
raise OrganizationAdministratorRequired()
raise OrganizationAdministratorRequiredError()
if (
user_profile.realm.bot_creation_policy == Realm.BOT_CREATION_LIMIT_GENERIC_BOTS
and bot_type == UserProfile.DEFAULT_BOT
):
raise OrganizationAdministratorRequired()
raise OrganizationAdministratorRequiredError()
def check_valid_bot_type(user_profile: UserProfile, bot_type: int) -> None:
@@ -255,7 +255,7 @@ def access_bot_by_id(user_profile: UserProfile, user_id: int) -> UserProfile:
# default, because it can be abused to send spam. Requiring an
# owner is intended to ensure organizational responsibility
# for use of this permission.
raise OrganizationOwnerRequired()
raise OrganizationOwnerRequiredError()
return target