(20260309) Added new 'mode' for formatting the muster roll'.

This commit is contained in:
2026-03-09 17:25:35 +05:30
parent c3ab2e4d9a
commit 4350435a01
8 changed files with 94 additions and 16 deletions
+12 -1
View File
@@ -187,7 +187,8 @@ async def muster_roll_report_generate(
success = False
report_data = None
# Figure out the paths:
# Figure out the paths,
# and read the records:
proj_dir = files.get_parent_directory(
files.get_file_directory(include_filename = False),
depth = 4
@@ -201,6 +202,16 @@ async def muster_roll_report_generate(
# Note down the status of success or failure:
success = True if report_data else False
# format the report as required:
if success:
if inbound_data.mode == "array":
pass # ... already an array
elif inbound_data.mode == "map":
report_data["report"] = {
r["UserID"]: {k: v for k,v in r.items if k != "User ID"}
for r in report_data["report"]
}
# ┳┓
# ┣┫┏┓┏┏┓┏┓┏┓┏┏┓
# ┛┗┗ ┛┣┛┗┛┛┗┛┗