Gruppen im Profil
This commit is contained in:
parent
6c8609b281
commit
9b90be5f5b
@ -378,18 +378,28 @@ def profil():
|
|||||||
u.mandant_id,
|
u.mandant_id,
|
||||||
u.last_login,
|
u.last_login,
|
||||||
u.status,
|
u.status,
|
||||||
|
|
||||||
m.name AS mandant_name,
|
m.name AS mandant_name,
|
||||||
m.kuerzel AS mandant_kuerzel,
|
m.kuerzel AS mandant_kuerzel,
|
||||||
m.kontakt_email AS mandant_email,
|
m.kontakt_email AS mandant_email,
|
||||||
m.level AS mandant_level
|
m.level AS mandant_level
|
||||||
|
|
||||||
FROM app_user u
|
FROM app_user u
|
||||||
JOIN mandant m ON m.id = u.mandant_id
|
JOIN mandant m ON m.id = u.mandant_id
|
||||||
WHERE u.id = %s
|
WHERE u.id = %s
|
||||||
""", (session["user_id"],))
|
""", (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()
|
cur.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
@ -398,7 +408,8 @@ def profil():
|
|||||||
"profil.html",
|
"profil.html",
|
||||||
page_title="Profil",
|
page_title="Profil",
|
||||||
active_page="profil",
|
active_page="profil",
|
||||||
profile=user_data,
|
profile=profile,
|
||||||
|
gruppen=gruppen,
|
||||||
**get_current_user()
|
**get_current_user()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,17 @@
|
|||||||
<tr><th>Mandant</th><td>{{ profile.mandant_name }} ({{ profile.mandant_kuerzel }})</td></tr>
|
<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 E-Mail</th><td>{{ profile.mandant_email or '-' }}</td></tr>
|
||||||
<tr><th>Mandant Level</th><td>{{ profile.mandant_level }}</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>
|
</table>
|
||||||
|
|
||||||
<div class="admin-actions">
|
<div class="admin-actions">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user