Enhance user identifier formatting and improve user organization display with titles
This commit is contained in:
parent
cd834e768d
commit
7594b66520
4 changed files with 62 additions and 26 deletions
|
|
@ -72,7 +72,7 @@ def user(id):
|
|||
|
||||
@main.route("/user/<id>/org")
|
||||
def user_org(id):
|
||||
user = eager_load_user_relationships(db.session.query(User).filter(User.id == id)).first()
|
||||
user = eager_load_user_relationships(db.session.query(User).filter(User.id == id).order_by(User.first_name, User.last_name)).first()
|
||||
if not user:
|
||||
return render_template('error.html', title='User Not Found', message=f'User with ID {id} not found.')
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ def user_org(id):
|
|||
while current_user:
|
||||
subordinates = (
|
||||
eager_load_user_relationships(
|
||||
db.session.query(User).filter(User.supervisor_id == current_user.id)
|
||||
db.session.query(User).filter(User.supervisor_id == current_user.id).order_by(User.first_name, User.last_name)
|
||||
).all()
|
||||
)
|
||||
org_chart.insert(0, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue