Gruppen im Profil
This commit is contained in:
parent
6c8609b281
commit
9b90be5f5b
@ -372,24 +372,34 @@ def profil():
|
||||
|
||||
cur.execute("""
|
||||
SELECT
|
||||
u.id,
|
||||
u.email,
|
||||
u.name,
|
||||
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
|
||||
|
||||
u.id,
|
||||
u.email,
|
||||
u.name,
|
||||
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()
|
||||
)
|
||||
|
||||
|
||||
@ -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">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user