aboutsummaryrefslogtreecommitdiff
path: root/modules/config.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-15 18:42:14 +0100
committerGravatar jesopo2019-06-15 18:42:14 +0100
commit8ab4880c5cac3305b4379aafe5bcf1bbd9a8e888 (patch)
tree4f355c36d0f7f3058b2f0338d25c595b52c6477e /modules/config.py
parentRemove debug yield check (diff)
Change from `yield` checks to a func in `events` that pass up EventErrors
Diffstat (limited to 'modules/config.py')
-rw-r--r--modules/config.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/modules/config.py b/modules/config.py
index bf98d588..d48480c7 100644
--- a/modules/config.py
+++ b/modules/config.py
@@ -137,14 +137,15 @@ class Module(ModuleManager.BaseModule):
if context == "set":
if name:
- yield utils.Check("self", name)|permission_check
+ event["check_assert"](
+ utils.Check("self", name)|permission_check)
target = event["server"].get_user(name)
else:
target = event["user"]
elif context == "channelset":
-
if name:
- yield permission_check
+ event["check_assert"](permission_check)
+
if name in event["server"].channels:
target = event["server"].channels.get(name)
else:
@@ -152,14 +153,15 @@ class Module(ModuleManager.BaseModule):
name)
else:
if event["is_channel"]:
- yield utils.Check("channel-mode", "o")|permission_check
+ event["check_assert"](
+ utils.Check("channel-mode", "o")|permission_check)
target = event["target"]
else:
raise utils.EventError(
"Cannot change config for current channel when in "
"private message")
elif context == "serverset" or context == "botset":
- yield permission_check
+ event["check_assert"](permission_check)
export_settings = self._get_export_setting(context)
if not setting == None: