Add user creation and update functionality; refactor user template and helpers

This commit is contained in:
Yaro Kasear 2025-07-07 15:36:15 -05:00
parent f4369348c5
commit 26e55b9a3e
6 changed files with 134 additions and 24 deletions

View file

@ -11,15 +11,10 @@ from ..utils.load import eager_load_room_relationships
@main.route('/settings', methods=['GET', 'POST'])
def settings():
if request.method == 'POST':
print("⚠️⚠️⚠️ POST /settings reached! ⚠️⚠️⚠️")
form = request.form
print("📝 Raw form payload:", form)
try:
state = json.loads(form['formState'])
import pprint
print("🧠 Parsed state:")
pprint.pprint(state, indent=2, width=120)
except Exception:
flash("Invalid form state submitted. JSON decode failed.", "danger")
traceback.print_exc()
@ -58,12 +53,9 @@ def settings():
function_map=function_map
)
print("✅ COMMIT executed.")
flash("Changes saved.", "success")
except Exception as e:
print("❌ COMMIT FAILED ❌")
traceback.print_exc()
flash(f"Error saving changes: {e}", "danger")
return redirect(url_for('main.settings'))