commit 56792a94c7d9141e26503054c010c89e4a7dbc04
parent 1d49cacd540db0e34e7ed6b6ba2ed160847c63ef
Author: parazyd <parazyd@dyne.org>
Date: Tue, 22 Jan 2019 00:38:04 +0100
Fix bug where emails are not matched to profiles in gallery.
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/diaspora.py b/diaspora.py
@@ -275,7 +275,8 @@ def country():
if i['email']:
uid = sql_select_col_where('id', 'email', i['email'],
table='users')
- profiles['email'] = uid[0][0]
+ if uid:
+ profiles[i['email']] = uid[0][0]
return render_template('country.html', country=getcountryname(ccode),
cc=ccode, stories=stories, clist=clist,
@@ -343,7 +344,8 @@ def dashboard():
if i['email']:
uid = sql_select_col_where('id', 'email', i['email'],
table='users')
- profiles['email'] = uid[0][0]
+ if uid:
+ profiles[i['email']] = uid[0][0]
return render_template('dashboard.html', stories=stories,
filtered_stories=filtered, profiles=profiles,
diff --git a/templates/gallery.html b/templates/gallery.html
@@ -39,8 +39,8 @@
</div>
<p class="text-muted text-right">
- {% if i['email'] and profiles %}
- by <a href="/profile?id={{ profiles['email'] }}">{{ i['name'] }}</a><br>
+ {% if i['email'] and profiles[i['email']] %}
+ by <a href="/profile?id={{ profiles[i['email']] }}">{{ i['name'] }}</a><br>
{% else %}
by {{ i['name'] }}<br>
{% endif %}