Skip to content

Commit 4fd266f

Browse files
committed
models: Override 'create' for PatchComment to automatically remove the PatchInterest for the commenting user
Signed-off-by: andrepapoti <andrepapoti@gmail.com>
1 parent 5ee94b5 commit 4fd266f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

patchwork/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,12 @@ def save(self, *args, **kwargs):
822822
super(PatchComment, self).save(*args, **kwargs)
823823
self.patch.refresh_tag_counts()
824824

825+
def create(self, *args, **kwargs):
826+
submitter = kwargs.get('submitter')
827+
patch = kwargs.get('patch')
828+
PatchReviewIntention.objects.delete(user=submitter.user, patch=patch)
829+
super(PatchComment, self).create(*args, **kwargs)
830+
825831
def delete(self, *args, **kwargs):
826832
super(PatchComment, self).delete(*args, **kwargs)
827833
self.patch.refresh_tag_counts()

0 commit comments

Comments
 (0)