Apr 2 2026: update user's info, adding Full Name record

This commit is contained in:
2026-04-02 16:53:09 -04:00
parent bda4b3f5b3
commit 51d8088b25
10 changed files with 94 additions and 11 deletions
+6 -3
View File
@@ -74,6 +74,7 @@ def profile():
form = ProfileForm(user=current_user, obj=current_user)
if form.validate_on_submit():
current_user.full_name = form.full_name.data.strip() or None
current_user.email = form.email.data
if form.new_password.data:
@@ -134,6 +135,7 @@ def create_user():
if form.validate_on_submit():
user = User(
username=form.username.data,
full_name=form.full_name.data.strip() or None,
email=form.email.data,
role=form.role.data
)
@@ -158,9 +160,10 @@ def edit_user(user_id):
form = UserForm(user=user, obj=user)
if form.validate_on_submit():
user.username = form.username.data
user.email = form.email.data
user.role = form.role.data
user.username = form.username.data
user.full_name = form.full_name.data.strip() or None
user.email = form.email.data
user.role = form.role.data
if form.password.data:
user.set_password(form.password.data)
+8 -6
View File
@@ -107,10 +107,11 @@ def create():
if form.validate_on_submit():
user = User(
username = form.username.data,
email = form.email.data,
role = 'customer',
active = True,
username = form.username.data,
full_name = form.full_name.data.strip() or None,
email = form.email.data,
role = 'customer',
active = True,
)
user.set_password(form.password.data)
db.session.add(user)
@@ -139,8 +140,9 @@ def edit(customer_id):
form = CustomerUserForm(user=customer, obj=customer)
if form.validate_on_submit():
customer.username = form.username.data
customer.email = form.email.data
customer.username = form.username.data
customer.full_name = form.full_name.data.strip() or None
customer.email = form.email.data
if form.password.data:
customer.set_password(form.password.data)
db.session.commit()