Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rating duplication in profile #4592

Merged
merged 4 commits into from
Jun 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1903,6 +1903,11 @@ def profile(request, handle):
sent_kudos = None
handle = handle.replace("@", "")

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noiceeee


try:
if not handle and not request.user.is_authenticated:
return redirect('funder_bounties')
Expand Down Expand Up @@ -1999,15 +2004,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