From 4ad725e6327a76018267ebbd1125ce6d3ec54ecf Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Wed, 7 Oct 2020 15:15:05 +0530 Subject: [PATCH] throw in shit fix to ensure right projects load --- app/dashboard/router.py | 9 +++++++++ app/grants/management/commands/ingest_grant_txns.py | 4 ++-- app/grants/urls.py | 10 +++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/dashboard/router.py b/app/dashboard/router.py index 15a13c647ab..4bae2a3bc74 100644 --- a/app/dashboard/router.py +++ b/app/dashboard/router.py @@ -263,6 +263,15 @@ def get_queryset(self): bounty__bounty_owner_github_username=sponsor)).exclude( status='invalid').prefetch_related('profiles', 'bounty').order_by('-winner', order_by, 'id') + projects = [] + for project in queryset: + bounty = project.bounty + org_name = bounty.org_name + if org_name != sponsor: + projects.append(project.pk) + + queryset = queryset.exclude(pk__in=projects) + if q: queryset = queryset.filter( Q(name__icontains=q) | diff --git a/app/grants/management/commands/ingest_grant_txns.py b/app/grants/management/commands/ingest_grant_txns.py index 8f1164a49f6..8cfd21bcf9f 100644 --- a/app/grants/management/commands/ingest_grant_txns.py +++ b/app/grants/management/commands/ingest_grant_txns.py @@ -20,15 +20,15 @@ import datetime import os -import pytz from django.conf import settings from django.core.management.base import BaseCommand +import pytz import requests from dashboard.models import Activity, Profile -from economy.tx import headers from economy.models import Token +from economy.tx import headers from economy.utils import convert_token_to_usdt from grants.models import Contribution, Grant, Subscription from web3 import Web3 diff --git a/app/grants/urls.py b/app/grants/urls.py index bc7bd0c5aa2..5aa937c5f88 100644 --- a/app/grants/urls.py +++ b/app/grants/urls.py @@ -21,11 +21,11 @@ from grants.views import ( add_grant_from_collection, bulk_fund, bulk_grants_for_cart, clr_grants, flag, get_collection, get_collections_list, - get_grant_payload, get_grants, get_replaced_tx, grant_activity, grant_categories, grant_details, grant_fund, - grant_new, grant_new_whitelabel, grants, grants_addr_as_json, grants_bulk_add, grants_by_grant_type, - grants_cart_view, grants_clr, grants_stats_view, invoice, leaderboard, new_matching_partner, profile, quickstart, - remove_grant_from_collection, save_collection, subscription_cancel, toggle_grant_favorite, verify_grant, - zksync_get_interrupt_status, zksync_set_interrupt_status, grants_zksync_recovery_view, get_interrupted_contributions + get_grant_payload, get_grants, get_interrupted_contributions, get_replaced_tx, grant_activity, grant_categories, + grant_details, grant_fund, grant_new, grant_new_whitelabel, grants, grants_addr_as_json, grants_bulk_add, + grants_by_grant_type, grants_cart_view, grants_clr, grants_stats_view, grants_zksync_recovery_view, invoice, + leaderboard, new_matching_partner, profile, quickstart, remove_grant_from_collection, save_collection, + subscription_cancel, toggle_grant_favorite, verify_grant, zksync_get_interrupt_status, zksync_set_interrupt_status, ) app_name = 'grants'