Gruppen im Profil

This commit is contained in:
Bkolb 2026-04-02 20:11:04 +02:00
parent 6c8609b281
commit 9b90be5f5b
2 changed files with 36 additions and 14 deletions

View File

@ -378,18 +378,28 @@ def profil():
u.mandant_id,
u.last_login,
u.status,
m.name AS mandant_name,
m.kuerzel AS mandant_kuerzel,
m.kontakt_email AS mandant_email,
m.level AS mandant_level
FROM app_user u
JOIN mandant m ON m.id = u.mandant_id
WHERE u.id = %s
""", (session["user_id"],))
user_data = fetchone_dict(cur)
profile = fetchone_dict(cur)
cur.execute("""
SELECT g.group_name
FROM user_group ug
JOIN app_group g ON g.id = ug.group_id
WHERE ug.user_id = %s
AND ug.mandant_id = %s
ORDER BY g.group_name
""", (session["user_id"], session["mandant_id"]))
gruppen_rows = fetchall_dict(cur)
gruppen = [row["group_name"] for row in gruppen_rows]
cur.close()
conn.close()
@ -398,7 +408,8 @@ def profil():
"profil.html",
page_title="Profil",
active_page="profil",
profile=user_data,
profile=profile,
gruppen=gruppen,
**get_current_user()
)

View File

@ -11,6 +11,17 @@
<tr><th>Mandant</th><td>{{ profile.mandant_name }} ({{ profile.mandant_kuerzel }})</td></tr>
<tr><th>Mandant E-Mail</th><td>{{ profile.mandant_email or '-' }}</td></tr>
<tr><th>Mandant Level</th><td>{{ profile.mandant_level }}</td></tr>
<tr>
<th>Gruppen im Mandanten</th>
<td>
{% if gruppen %}
{{ gruppen | join(', ') }}
{% else %}
-
{% endif %}
</td>
</tr>
</table>
<div class="admin-actions">