From d011550f3a6b5bf17dc127e2a69e992d6685599d Mon Sep 17 00:00:00 2001 From: Simon Cloutier Date: Thu, 10 Apr 2025 08:12:42 -0400 Subject: [PATCH] fix saving, remove unused function --- app/db_interface.py | 16 ---------------- app/templates/group_list.html | 21 +++++++++------------ 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/app/db_interface.py b/app/db_interface.py index bc503b9..cff8597 100644 --- a/app/db_interface.py +++ b/app/db_interface.py @@ -119,22 +119,6 @@ def add_group(vlan_id, description): cursor.close() conn.close() -def duplicate_group(vlan_id): - """Create a duplicate of a group with an incremented VLAN ID.""" - conn = get_connection() - cursor = conn.cursor(dictionary=True) - cursor.execute("SELECT vlan_id, description FROM groups WHERE vlan_id = %s", (vlan_id,)) - group = cursor.fetchone() - - if group: - new_vlan_id = int(group['vlan_id']) + 1 # Auto-increment logic - new_description = f"{group['description']} Copy" if group['description'] else None - cursor.execute("INSERT INTO groups (vlan_id, description) VALUES (%s, %s)", (new_vlan_id, new_description)) - conn.commit() - - cursor.close() - conn.close() - def update_group_description(vlan_id, description): """Update the description for a given MAC address in the users table.""" # Docstring seems incorrect (mentions MAC address), but keeping original text. diff --git a/app/templates/group_list.html b/app/templates/group_list.html index c0d95f3..4c8af18 100644 --- a/app/templates/group_list.html +++ b/app/templates/group_list.html @@ -22,20 +22,17 @@ {% for group in available_groups %} - {{ group.vlan_id }} - -
- + + + {{ group.vlan_id }} + -
- - {{ group.user_count }} - -
- - + + {{ group.user_count }} + -
+ +