diff --git a/files/classes/submission.py b/files/classes/submission.py index 9cfa350a8..72e6caabe 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -70,11 +70,6 @@ class Submission(Base): def __repr__(self): return f"" - @property - @lazy - def comments2(self): - return g.db.query(Comment.author_id, Comment.created_utc, Comment.id).filter(Comment.parent_submission == self.id, Comment.author_id.notin_((AUTOPOLLER_ID,AUTOBETTER_ID, AUTOCHOICE_ID))).all() - @property @lazy def controversial(self): diff --git a/files/templates/comments.html b/files/templates/comments.html index 80eaedb67..f4841e2b2 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -894,9 +894,9 @@ lastCount = comments['{{p.id}}'] if (lastCount) { - {% for c in p.comments2 %} - {% if not (v and v.id==c[0]) and not c.voted %} - if ({{c[1]*1000}} > lastCount.t) + {% for c in p.comments %} + {% if not (v and v.id==c.author_id) and not c.voted %} + if ({{c.created_utc*1000}} > lastCount.t) try {document.getElementById("comment-{{c.id}}-only").classList.add('unread2')} catch(e) {} {% endif %} @@ -924,9 +924,9 @@ lastCount = comments['{{p.id}}'] if (lastCount) { - {% for c in p.comments2 %} - {% if not (v and v.id==c[0]) and not c.voted %} - if ({{c[1]*1000}} > lastCount.t) + {% for c in p.comments %} + {% if not (v and v.id==c.author_id) and not c.voted %} + if ({{c.created_utc*1000}} > lastCount.t) try {document.getElementById("comment-{{c.id}}-only").classList.add('unread2')} catch(e) {} {% endif %} diff --git a/files/templates/submission.html b/files/templates/submission.html index 32b98cb43..e860f6786 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -996,9 +996,9 @@ lastCount = comments['{{p.id}}'] if (lastCount) { - {% for c in p.comments2 %} - {% if not (v and v.id==c[0]) and not c.voted %} - if ({{c[1]*1000}} > lastCount.t) + {% for c in p.comments %} + {% if not (v and v.id==c.author_id) and not c.voted %} + if ({{c.created_utc*1000}} > lastCount.t) try {document.getElementById("comment-{{c.id}}-only").classList.add('unread2')} catch(e) {} {% endif %}