From 7907951f49405717cf49444991382f21493eaff8 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Fri, 7 Jun 2019 13:48:07 -0300 Subject: [PATCH] add network and current to queries --- app/dashboard/views.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 05f190302c4..1c1b49dc0ab 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1908,6 +1908,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') @@ -2004,15 +2009,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(