diff --git a/files/templates/comments.html b/files/templates/comments.html
index 0122e86df..e9a22d41a 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -139,7 +139,7 @@
{% for b in c.author.badges %}
- {% if c.author.url %}
+ {% if b.url %}
{% else %}
diff --git a/files/templates/submission.html b/files/templates/submission.html
index 90163ffac..4a20ffc7b 100644
--- a/files/templates/submission.html
+++ b/files/templates/submission.html
@@ -272,7 +272,7 @@
{% for b in p.author.badges %}
- {% if p.author.url %}
+ {% if b.url %}
{% else %}
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html
index c0a68948d..1d2ecdb88 100644
--- a/files/templates/submission_listing.html
+++ b/files/templates/submission_listing.html
@@ -49,7 +49,7 @@
{% for b in p.author.badges %}
- {% if p.author.url %}
+ {% if b.url %}
{% else %}