Fix traceback from ingame reports contrib help manage command. Resolve #3627

This commit is contained in:
Griatch 2024-10-21 21:13:47 +02:00
parent 67db991715
commit 04374e5392
2 changed files with 14 additions and 8 deletions

View file

@ -14,6 +14,7 @@
- [Fix][pull3645]: Correct `character_creator` contrib's error return (InspectorCaracal)
- [Fix][pull3640]: Typo fixes for conjugate verbs (aMiss-aWry)
- [Fix][pull3647]: Contents cache didn't reset internal typecache on use of `init` hook (InspectorCaracal)
- [Fix][issue3627]: Traceback from contrib `in-game reports` `help manage` command (Griatch)
- [Docs][pull3576]: Rework doc for [Pycharm howto][doc-pycharm]
- Docs updates: feykrh, Griatch
@ -27,6 +28,7 @@
[pull3640]: https://github.com/evennia/evennia/pull/3640
[pull3647]: https://github.com/evennia/evennia/pull/3647
[pull3635]: https://github.com/evennia/evennia/pull/3635
[issue3627]: https://github.com/evennia/evennia/issues/3627
[doc-pycharm]: https://www.evennia.com/docs/latest/Coding/Setting-up-PyCharm.html
## Evennia 4.4.1

View file

@ -32,12 +32,11 @@ The contrib can be further configured through two settings, `INGAME_REPORT_TYPES
"""
from django.conf import settings
from evennia import CmdSet
from evennia.utils import create, evmenu, logger, search
from evennia.utils.utils import class_from_module, datetime_format, is_iter, iter_to_str
from evennia.commands.default.muxcommand import MuxCommand
from evennia.comms.models import Msg
from evennia.utils import create, evmenu, logger, search
from evennia.utils.utils import class_from_module, datetime_format, is_iter, iter_to_str
from . import menu
@ -68,6 +67,7 @@ def _get_report_hub(report_type):
"""
hub_key = f"{report_type}_reports"
from evennia import GLOBAL_SCRIPTS
if not (hub := GLOBAL_SCRIPTS.get(hub_key)):
hub = create.create_script(key=hub_key)
return hub or None
@ -92,7 +92,7 @@ class CmdManageReports(_DEFAULT_COMMAND_CLASS):
aliases = tuple(f"manage {report_type}" for report_type in _REPORT_TYPES)
locks = "cmd:pperm(Admin)"
def get_help(self):
def get_help(self, caller, cmdset):
"""Returns a help string containing the configured available report types"""
report_types = iter_to_str("\n ".join(_REPORT_TYPES))
@ -212,7 +212,11 @@ class ReportCmdBase(_DEFAULT_COMMAND_CLASS):
receivers.append(target)
if self.create_report(
self.account, self.report_message, receivers=receivers, locks=self.report_locks, tags=["report"]
self.account,
self.report_message,
receivers=receivers,
locks=self.report_locks,
tags=["report"],
):
# the report Msg was successfully created
self.msg(self.success_msg)