+
There are currently no groups.
+
+{% endif %}
+{% endblock content %}
diff --git a/lumi2/usermanager.py b/lumi2/usermanager.py
index c039c92..a8b1e10 100644
--- a/lumi2/usermanager.py
+++ b/lumi2/usermanager.py
@@ -58,10 +58,10 @@ def user_view(username: str):
conn.unbind()
abort(404)
- user._generate_static_images()
conn.unbind()
return render_template('usermanager/user_view.html',user=user)
+
@bp.route("/users/list")
def user_list():
"""Displays a list of all users."""
@@ -73,9 +73,6 @@ def user_list():
except Exception:
abort(500)
- for user in users:
- user._generate_static_images()
-
return render_template(
'usermanager/user_list.html',
users=users,
@@ -238,8 +235,6 @@ def user_update(username: str):
conn.unbind()
abort(404)
- user._generate_static_images()
-
form = UserUpdateForm(obj=user)
if form.validate_on_submit():
if form.email.data:
@@ -252,14 +247,11 @@ def user_update(username: str):
user.display_name = form.display_name.data
if form.password.data:
user.password_hash = User.generate_password_hash(form.password.data)
- picture_updated = False
if form.picture.data and form.picture.data.filename:
user.picture = Image.open(form.picture.data, formats=['JPEG'])
- picture_updated = True
+ user._generate_static_images(force=True)
ldap.update_user(conn, user)
- if picture_updated:
- user._generate_static_images(force=True)
conn.unbind()
flash(f"Information for user '{user.username}' was updated.")
return redirect(url_for('usermanager.user_view', username=user.username))
@@ -315,6 +307,57 @@ def user_delete(username: str):
)
+@bp.route("/groups/list")
+def group_list():
+ """Displays a list of all groups."""
+
+ try:
+ conn = ldap.get_connection()
+ groups = ldap.get_groups(conn)
+ conn.unbind()
+ except Exception:
+ abort(500)
+
+ return render_template(
+ 'usermanager/group_list.html',
+ groups=groups,
+ )
+
+
+@bp.route("/groups/create", methods=("GET", "POST"))
+def group_create():
+ """Displays a form allowing group creation."""
+
+ try:
+ conn = ldap.get_connection()
+ except Exception:
+ abort(500)
+
+ conn.unbind()
+ # TODO implement
+ abort(404)
+
+
+@bp.route("/groups/view/