Improvements to user views and forms + correction of schema creation for new tenants.
This commit is contained in:
@@ -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')
|
||||
Reference in New Issue
Block a user