summaryrefslogtreecommitdiffstats
path: root/templates/public/keys.html
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-12-02 06:15:30 +0100
committerDan McGee <dan@archlinux.org>2013-12-14 17:52:51 +0100
commit3b1b677b49af194313da766579e9fa1a021afd84 (patch)
tree475e9da703e745660d97df5e6827941bbea7595c /templates/public/keys.html
parentcd427ead7e71bb5d7716f015b1f9753ee56a9b4e (diff)
downloadarchweb-3b1b677b49af194313da766579e9fa1a021afd84.tar.gz
archweb-3b1b677b49af194313da766579e9fa1a021afd84.tar.xz
Speed up master key listing page
We were spending a lot of time getting the developer name for a given key on this page, which involved sending one query per key ID. Use the cache to our advantage here and save ourselves the "expensive" lookups. This eliminates ~100 queries per page load. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/public/keys.html')
-rw-r--r--templates/public/keys.html8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/public/keys.html b/templates/public/keys.html
index c7272db..54d52ab 100644
--- a/templates/public/keys.html
+++ b/templates/public/keys.html
@@ -86,16 +86,16 @@
</tr>
</thead>
<tbody>
- {% for user in active_users %}
+ {% for user in active_users %}{% with user_key=user.userprofile.pgp_key %}
<tr>
<th>{{ user.get_full_name }}</th>
- <td>{% pgp_key_link user.userprofile.pgp_key %}</td>
+ <td>{% pgp_key_link user_key %}</td>
{% spaceless %}{% for key in keys %}
- {% signature_exists signatures key.pgp_key user.userprofile.pgp_key as signed %}
+ {% signature_exists signatures key.pgp_key user_key as signed %}
<td class="signed-{{ signed|yesno }}">{{ signed|yesno|capfirst }}</td>
{% endfor %}{% endspaceless %}
</tr>
- {% endfor %}
+ {% endwith %}{% endfor %}
</tbody>
</table>
</div>