]> git.ipfire.org Git - thirdparty/patchwork.git/commit
models: Fix invocation of refresh_tag_counts() for Comments
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Sun, 20 Aug 2017 14:40:10 +0000 (00:40 +1000)
committerStephen Finucane <stephen@that.guru>
Wed, 23 Aug 2017 16:19:00 +0000 (17:19 +0100)
commit866d14b4c1ce64e20ec4d2e7b3dd7667188ab630
tree766aaa3ca77cde5e31dc61570e0c9a3fd7e9fc61
parentc4ad0d8842482f3dc6b65f47f0cef8188a33aeac
models: Fix invocation of refresh_tag_counts() for Comments

In Comment.save() and Comment.delete(), we always call
Submission.refresh_tag_counts(), which is an empty stub, rather than
calling Patch.refresh_tag_counts() if the Submission is a Patch.

As such, tag counts are never updated on incoming comments.

Delete Submission.refresh_tag_counts(), as it's useless, and in
Comment.save()/delete(), invoke Patch.refresh_tag_counts() directly when
the submission is a Patch.

Reported-by: David Demelier <markand@malikania.fr>
Fixes: 86172ccc161b ("models: Split Patch into two models")
Closes-bug: #111 ("A/R/T not updated on comments")
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Stephen Finucane <stephen@that.guru>
patchwork/models.py