cleanup admin checklist

This commit is contained in:
SpudGunMan
2025-10-29 11:15:02 -07:00
parent e5e8fbd0b5
commit 313c313412
3 changed files with 13 additions and 14 deletions

View File

@@ -40,10 +40,10 @@ def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_n
"bbspost": lambda: handle_bbspost(message, message_from_id, deviceID),
"bbsread": lambda: handle_bbsread(message),
"blackjack": lambda: handleBlackJack(message, message_from_id, deviceID),
"okcl": lambda: handle_checklist(message, message_from_id, deviceID),
"denycl": lambda: handle_checklist(message, message_from_id, deviceID),
"checkin": lambda: handle_checklist(message, message_from_id, deviceID),
"checklist": lambda: handle_checklist(message, message_from_id, deviceID),
"checklistapprove": lambda: handle_checklist(message, message_from_id, deviceID),
"checklistdeny": lambda: handle_checklist(message, message_from_id, deviceID),
"checkout": lambda: handle_checklist(message, message_from_id, deviceID),
"chess": lambda: handle_gTnW(chess=True),
"clearsms": lambda: handle_sms(message_from_id, message),

View File

@@ -33,13 +33,13 @@ The enhanced checklist module provides asset tracking and accountability feature
- Provides `get_overdue_checkins()` function for alert integration
- **Approval Workflow**:
- `checklistapprove <id>` - Approve pending check-ins (admin)
- `checklistdeny <id>` - Deny/remove check-ins (admin)
- `clok <id>` - Approve pending check-ins (admin)
- `denycl <id>` - Deny/remove check-ins (admin)
- Support for approval-based workflows
#### New Commands:
- `checklistapprove <id>` - Approve a check-in
- `checklistdeny <id>` - Deny a check-in
- `clok <id>` - Approve a check-in
- `denycl <id>` - Deny a check-in
- Enhanced `checkin [interval] [note]` - Now supports interval parameter
### Enhanced Check Out Options
@@ -155,19 +155,19 @@ ID: Tech2 checked-In for 00:15:30📝Equipment repair
#### Approve Check-in
```
checklistapprove <checkin_id>
clok <checkin_id>
```
Approve a pending check-in (requires admin privileges).
**Example:**
```
checklistapprove 123
clok 123
```
#### Deny Check-in
```
checklistdeny <checkin_id>
denycl <checkin_id>
```
Deny and remove a check-in (requires admin privileges).

View File

@@ -6,8 +6,7 @@ from modules.log import logger
from modules.settings import checklist_db, reverse_in_out, bbs_ban_list, bbs_admin_list
import time
trap_list_checklist = ("checkin", "checkout", "checklist",
"checklistapprove", "checklistdeny", "checklistadd", "checklistremove")
trap_list_checklist = ("checkin", "checkout", "checklist", "okcl", "denycl",)
def initialize_checklist_database():
try:
@@ -413,7 +412,7 @@ def process_checklist_command(nodeID, message, name="none", location="none"):
# elif "purgeout" in message_lower:
# return mark_checkout_removed_by_name(name)
elif message_lower.startswith("checklistapprove "):
elif "okcl " in message_lower:
if not is_admin:
return "You do not have permission to approve check-ins."
try:
@@ -421,8 +420,8 @@ def process_checklist_command(nodeID, message, name="none", location="none"):
return approve_checkin(checkin_id)
except (ValueError, IndexError):
return "Usage: checklistapprove <checkin_id>"
elif message_lower.startswith("checklistdeny "):
elif "denycl " in message_lower:
if not is_admin:
return "You do not have permission to deny check-ins."
try: