Skip to content

Commit 9fbcd31

Browse files
committed
views: fix include in attention set and review interest count
1 parent b118494 commit 9fbcd31

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

patchwork/templatetags/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def patch_commit_display(patch):
7979

8080
@register.filter(name='patch_interest')
8181
def patch_interest(patch):
82-
reviews = patch.attention_set.count()
82+
reviews = patch.patchattentionset_set.filter(removed=False).count()
8383
review_title = (
8484
f'has {reviews} interested reviewers'
8585
if reviews > 0

patchwork/views/patch.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ def patch_detail(request, project_id, msgid):
9090
elif action in ['add-interest', 'remove-interest']:
9191
if request.user.is_authenticated:
9292
if action == 'add-interest':
93-
PatchAttentionSet.objects.get_or_create(
94-
patch=patch, user=request.user
95-
)
93+
PatchAttentionSet.objects.upsert(patch, [request.user.id])
9694
message = (
9795
'You have declared interest in reviewing this patch'
9896
)

0 commit comments

Comments
 (0)