mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 12:56:30 +01:00
Merge pull request #3611 from InspectorCaracal/reports-patch
Update Reports contrib
This commit is contained in:
commit
186818c811
2 changed files with 7 additions and 7 deletions
|
|
@ -24,11 +24,6 @@ if hasattr(settings, "INGAME_REPORT_STATUS_TAGS"):
|
|||
def menunode_list_reports(caller, raw_string, **kwargs):
|
||||
"""Paginates and lists out reports for the provided hub"""
|
||||
hub = caller.ndb._evmenu.hub
|
||||
|
||||
page = kwargs.get("page", 0)
|
||||
start = page * _REPORTS_PER_PAGE
|
||||
end = start + _REPORTS_PER_PAGE
|
||||
report_slice = report_list[start:end]
|
||||
hub_name = " ".join(hub.key.split("_")).title()
|
||||
text = f"Managing {hub_name}"
|
||||
|
||||
|
|
@ -54,6 +49,11 @@ def menunode_list_reports(caller, raw_string, **kwargs):
|
|||
if not report_list:
|
||||
return "There is nothing there for you to manage.", {}
|
||||
|
||||
page = kwargs.get("page", 0)
|
||||
start = page * _REPORTS_PER_PAGE
|
||||
end = start + _REPORTS_PER_PAGE
|
||||
report_slice = report_list[start:end]
|
||||
|
||||
options = [
|
||||
{
|
||||
"desc": f"{datetime_format(report.date_created)} - {crop(report.message, 50)}",
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ def _get_report_hub(report_type):
|
|||
Note: If no matching valid script exists, this function will attempt to create it.
|
||||
"""
|
||||
hub_key = f"{report_type}_reports"
|
||||
# NOTE: due to a regression in GLOBAL_SCRIPTS, we use search_script instead of the container
|
||||
if not (hub := search.search_script(hub_key)):
|
||||
from evennia import GLOBAL_SCRIPTS
|
||||
if not (hub := GLOBAL_SCRIPTS.get(hub_key)):
|
||||
hub = create.create_script(key=hub_key)
|
||||
return hub or None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue