Skip to content

Commit 996dd39

Browse files
committed
Release v1.0.13 - Print CURRENT_USER on Index
1 parent 2e90f89 commit 996dd39

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## [1.0.13] 2023-06-22
4+
### Changes
5+
6+
- Print UserID on `index`
7+
- Via export in controller
8+
- Via `current_user` in view
9+
310
## [1.0.12] 2023-03-15
411
### Changes
512

apps/home/routes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55

66
from apps.home import blueprint
77
from flask import render_template, request
8-
from flask_login import login_required
8+
from flask_login import login_required, current_user
99
from jinja2 import TemplateNotFound
1010

1111

1212
@blueprint.route('/index')
1313
@login_required
1414
def index():
1515

16-
return render_template('home/index.html', segment='index')
17-
16+
return render_template('home/index.html',
17+
segment='index',
18+
user_id=current_user.id)
1819

1920
@blueprint.route('/<template>')
2021
@login_required

apps/templates/home/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@
120120
</div>
121121
<h1 class="fw-bolder">Volt Bootstrap 5 Dashboard</h1>
122122
<h2 class="lead fw-normal text-muted mb-5">
123-
Open-source Seed Project
123+
Open-source Project
124124
</h2>
125+
<p>
126+
UserID: [{{ user_id }}] - {{ current_user.email }}
127+
</p>
125128
<!-- Button Modal -->
126129
<div class="d-flex align-items-center justify-content-center mb-5">
127130
<a href="/dashboard.html" class="btn btn-secondary d-inline-flex align-items-center me-4">

0 commit comments

Comments
 (0)