diasporadiaries

a platform for writing stories with personal accounts and messages
git clone git://parazyd.org/diasporadiaries.git
Log | Files | Refs | Submodules | README | LICENSE

commit 5b8d5ef8a4ab84a1e0b7b29a42cec18ad3bdb391
parent 46f6573422add1440b7481d9d8c7b9ac2a5b6557
Author: parazyd <parazyd@dyne.org>
Date:   Thu, 24 Jan 2019 11:57:48 +0100

Fix country listing in /following.

Diffstat:
Mdiaspora.py | 6+++---
Mtemplates/following.html | 4++--
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/diaspora.py b/diaspora.py @@ -394,16 +394,16 @@ def following(): Route for listing the users a user is following. """ fol = [] - cnt = [] for i in get_following(current_user.username): j = find_user_by_email(i) if j: + cnt = [] countries = sql_select_col_where('disembark', 'email', j['email']) for k in countries: cnt.append((k[0], getcountryname(k[0]))) - fol.append((j['id'], j['name'])) + fol.append([j['id'], j['name'], cnt]) - return render_template('following.html', following=fol, countries=cnt) + return render_template('following.html', following=fol) @app.route('/dashboard') diff --git a/templates/following.html b/templates/following.html @@ -22,8 +22,8 @@ <h2><a href="/profile?id={{ i[0]}}">{{ i[1] }}</a></h2> </div> <div class="col"> - {% for i in countries %} - <img style="height: 2em;" src="/static/img/flags/{{ i[0] }}.png" alt="{{ i[1] }}" title="{{ i[1] }}"> + {% for j in i[2] %} + <img style="height: 2em;" src="/static/img/flags/{{ j[0] }}.png" alt="{{ j[1] }}" title="{{ j[1] }}"> {% endfor %} </div> <div class="col">