Improvements to user views and forms + correction of schema creation for new tenants.

This commit is contained in:
Josako
2024-06-03 13:24:13 +02:00
parent fcc0caeb09
commit c660c35de4
5 changed files with 73 additions and 10 deletions

View File

@@ -1,3 +1,6 @@
from flask import flash
def prepare_table(model_objects, column_names):
"""
Converts a list of SQLAlchemy model objects into a list of dictionaries based on specified column names.
@@ -34,3 +37,10 @@ def prepare_table_for_macro(model_objects, column_attrs):
]
for obj in model_objects
]
def form_validation_failed(request, form):
if request.method == 'POST':
for fieldName, errorMessages in form.errors.items():
for err in errorMessages:
flash(f"Error in {fieldName}: {err}", 'danger')