Skip to content

Commit

Permalink
Merge pull request #4592 from gitcoinco/fix/rating-duplication
Browse files Browse the repository at this point in the history
Fix rating duplication in profile
  • Loading branch information
thelostone-mc authored Jun 12, 2019
2 parents 3972a67 + 16d7221 commit 0a83ed3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,11 @@ def profile(request, handle):
sent_kudos = None
handle = handle.replace("@", "")

if not settings.DEBUG:
network = 'mainnet'
else:
network = 'rinkeby'

try:
if not handle and not request.user.is_authenticated:
return redirect('funder_bounties')
Expand Down Expand Up @@ -2013,15 +2018,16 @@ def profile(request, handle):
context['verification'] = profile.get_my_verified_check
context['avg_rating'] = profile.get_average_star_rating

context['unrated_funded_bounties'] = Bounty.objects.prefetch_related('fulfillments', 'interested', 'interested__profile', 'feedbacks') \
context['unrated_funded_bounties'] = Bounty.objects.current().prefetch_related('fulfillments', 'interested', 'interested__profile', 'feedbacks') \
.filter(
bounty_owner_github_username__iexact=profile.handle,
network=network,
).exclude(
feedbacks__feedbackType='approver',
feedbacks__sender_profile=profile,
)

context['unrated_contributed_bounties'] = Bounty.objects.current().prefetch_related('feedbacks').filter(interested__profile=profile) \
context['unrated_contributed_bounties'] = Bounty.objects.current().prefetch_related('feedbacks').filter(interested__profile=profile, network=network,) \
.filter(interested__status='okay') \
.filter(interested__pending=False).filter(idx_status='done') \
.exclude(
Expand Down

0 comments on commit 0a83ed3

Please sign in to comment.