From 542dcc05b0e857bfc67bff8c1a3ded8e528b9799 Mon Sep 17 00:00:00 2001 From: Mikkel <4072916+Mikk3@users.noreply.github.com> Date: Tue, 24 May 2022 15:45:56 +0200 Subject: [PATCH] Add groups template --- aula/Group/routes.py | 7 ++----- aula/templates/groups.html | 6 ++++++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 aula/templates/groups.html diff --git a/aula/Group/routes.py b/aula/Group/routes.py index 5ebb345..8914330 100644 --- a/aula/Group/routes.py +++ b/aula/Group/routes.py @@ -7,9 +7,6 @@ Group = Blueprint('Group', __name__) @Group.route("/groups/index", methods=['GET']) def index(): - user = select_users_by_id(5000) - groups = user.get_groups() - for group in groups: - print(group.name) - return "hej" + groups = current_user.get_groups() + return render_template('groups.html', groups=groups) diff --git a/aula/templates/groups.html b/aula/templates/groups.html new file mode 100644 index 0000000..cb74dd5 --- /dev/null +++ b/aula/templates/groups.html @@ -0,0 +1,6 @@ +{% extends "layout.html" %} +{% block content %} + {% for group in groups %} +

{{ group.name }}

+ {% endfor %} +{% endblock content %}