~sircmpwn/todo.sr.ht#246: 
Editing a comment will increase the total number of comments

If you go back to the tracker overview, you'll see that this ticket appears to have a higher number of comments than it actually does, beacuse I have edited the comment below.

Status
REPORTED
Submitter
~armaan
Assigned to
No-one
Submitted
3 months ago
Updated
2 months ago
Labels
No labels applied.

~armaan 3 months ago*

Total edits: 9

~nelsoch 2 months ago

After a quick browse, I suspect the problem is in here:

    https://git.sr.ht/~sircmpwn/todo.sr.ht/tree/master/item/todosrht/tickets.py

    def get_comment_counts(tickets):

    """Returns comment counts indexed by ticket id."""

    col = TicketComment.ticket_id

    return dict(db.session

    .query(col, func.count(col))

    .filter(col.in_([t.id for t in tickets]))

    .group_by(col))

Register here or Log in to comment, or comment via email.