fix bug, remove workaround

This commit is contained in:
Cal 2024-09-09 21:05:12 -06:00
parent 3adb93367c
commit 383969ce04
2 changed files with 7 additions and 7 deletions

View file

@ -24,11 +24,6 @@ if hasattr(settings, "INGAME_REPORT_STATUS_TAGS"):
def menunode_list_reports(caller, raw_string, **kwargs): def menunode_list_reports(caller, raw_string, **kwargs):
"""Paginates and lists out reports for the provided hub""" """Paginates and lists out reports for the provided hub"""
hub = caller.ndb._evmenu.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() hub_name = " ".join(hub.key.split("_")).title()
text = f"Managing {hub_name}" text = f"Managing {hub_name}"
@ -54,6 +49,11 @@ def menunode_list_reports(caller, raw_string, **kwargs):
if not report_list: if not report_list:
return "There is nothing there for you to manage.", {} 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 = [ options = [
{ {
"desc": f"{datetime_format(report.date_created)} - {crop(report.message, 50)}", "desc": f"{datetime_format(report.date_created)} - {crop(report.message, 50)}",

View file

@ -67,8 +67,8 @@ def _get_report_hub(report_type):
Note: If no matching valid script exists, this function will attempt to create it. Note: If no matching valid script exists, this function will attempt to create it.
""" """
hub_key = f"{report_type}_reports" hub_key = f"{report_type}_reports"
# NOTE: due to a regression in GLOBAL_SCRIPTS, we use search_script instead of the container from evennia import GLOBAL_SCRIPTS
if not (hub := search.search_script(hub_key)): if not (hub := GLOBAL_SCRIPTS.get(hub_key)):
hub = create.create_script(key=hub_key) hub = create.create_script(key=hub_key)
return hub or None return hub or None