Cosmetics to Tenant Domain Registration

This commit is contained in:
Josako
2024-06-04 15:10:51 +02:00
parent 766469d0ea
commit 1a25313673

View File

@@ -356,15 +356,16 @@ def tenant_domain():
try:
db.session.add(new_tenant_domain)
db.session.commit()
flash('Tenant Domain added successfully.')
flash('Tenant Domain added successfully.', 'success')
current_app.logger.info(f'Tenant Domain {new_tenant_domain.domain} added for tenant {session["tenant"]["id"]}')
except SQLAlchemyError as e:
db.session.rollback()
flash(f'Failed to add Tenant Domain. Error: {str(e)}')
flash(f'Failed to add Tenant Domain. Error: {str(e)}', 'danger')
current_app.logger.error(f'Failed to create Tenant Domain {new_tenant_domain.domain}. '
f'for tenant {session["tenant"]["id"]}'
f'Error: {str(e)}')
else:
flash('Please fill in all required fields.')
flash('Please fill in all required fields.', 'information')
return render_template('user/tenant_domain.html', form=form)