Skip to content

Commit

Permalink
feat(user-info): add db fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-cbna committed Mar 7, 2024
1 parent e268353 commit 05be383
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class TRoles(GenericRepository):
pass5 = db.Column("pass", db.Unicode)
pass_plus = db.Column(db.Unicode)
champs_addi = db.Column(JSONB)
date_insert = db.Column(db.DateTime, default=db.func.now(), nullable=False)
date_update = db.Column(db.DateTime, default=db.func.now(), nullable=False, onupdate=db.func.now())

# Add synonym for column pass
# Hack because pass is an python reserved word
Expand Down
23 changes: 23 additions & 0 deletions app/templates/info_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
{%set is_organisme = organisme is not none and organisme['nom_organisme'] != '' %}
{%set is_desc = user['desc_role'] is not none and user['desc_role'] != '' %}
{%set is_remarques = user['remarques'] is not none and user['remarques'] != '' %}
{%set is_date_insert = user['date_insert'] is not none and user['date_insert'] != '' %}
{%set is_date_update = user['date_update'] is not none and user['date_update'] != '' %}
{%set is_mail = user['email'] is not none and user['email'] != '' %}
{%set is_group = groups|length > 0 %}
{%set is_list = lists|length > 0 %}
Expand All @@ -31,6 +33,27 @@ <h3>Utilisateur "{{user['fullname']}}"</h3>
{% endif %}
{% if is_remarques %}
<br /><strong>Remarques :</strong> {{user['remarques']}}
{% endif %}
{% if user['pass_plus'] == "" or user["pass_plus"] is none %}
<br /><strong>Mot de passe Plus :</strong> Non
{%else %}
<br /><strong>Mot de passe Plus :</strong> Oui
{% endif %}
{% if user['pass_md5'] == "" or user["pass_md5"] is none %}
<br /><strong>Mot de passe Md5 :</strong> Non
{%else %}
<br /><strong>Mot de passe Md5 :</strong> Oui
{% endif %}
{% if user['active'] == True %}
<br /><strong>Compte Actif :</strong> Oui
{%else %}
<br /><strong>Compte Actif :</strong> Non
{% endif %}
{% if is_date_insert %}
<br /><strong class="text-muted">Date de création :</strong> {{user['date_insert']|truncate(10, True, '', 0)}}
{% endif %}
{% if is_date_update %}
<br /><strong class="text-muted">Date de mise à jour :</strong> {{user['date_update']|truncate(10, True, '', 0)}}
{% endif %}
</small>
</div>
Expand Down

0 comments on commit 05be383

Please sign in to comment.