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

GITC-223: ignore squelched profiles in clr #9312

Merged
merged 1 commit into from
Jul 23, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions app/app/bundle_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from cacheops import cached_as
from perftools.models import JSONStore


@cached_as(JSONStore.objects.filter(view='bundleTags', key='bundleTags'), timeout=60)
def templateTags():

Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from django.utils.safestring import mark_safe

from adminsortable2.admin import SortableInlineAdminMixin
from perftools.management.commands import create_page_cache

from .models import (
Activity, Answer, BlockedIP, BlockedURLFilter, BlockedUser, Bounty, BountyEvent, BountyFulfillment, BountyInvites,
Expand All @@ -35,7 +36,6 @@
TransactionHistory, TribeMember, TribesSubscription, UserAction, UserVerificationModel,
)

from perftools.management.commands import create_page_cache

class BountyEventAdmin(admin.ModelAdmin):
list_display = ['created_on', '__str__', 'event_type']
Expand Down
3 changes: 1 addition & 2 deletions app/dashboard/management/commands/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from django.template import Context, Template
from django.template.loaders.app_directories import get_app_template_dirs

from dashboard.templatetags.bundle import render

from app.bundle_context import context, templateTags
from dashboard.templatetags.bundle import render


def rmdir(loc, depth=1):
Expand Down
5 changes: 5 additions & 0 deletions app/grants/clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import numpy as np
from grants.models import Contribution, Grant, GrantCollection
from townsquare.models import SquelchProfile

CLR_PERCENTAGE_DISTRIBUTED = 0

Expand Down Expand Up @@ -289,6 +290,10 @@ def fetch_data(clr_round, network='mainnet'):
if subscription_filters:
contributions = contributions.filter(**subscription_filters)

# ignore profiles which have been squelched
profiles_to_be_ignored = SquelchProfile.objects.filter(active=True).values_list('profile__pk')
contributions = contributions.exclude(profile_for_clr__in=profiles_to_be_ignored)

grants = clr_round.grants.filter(network=network, hidden=False, active=True, is_clr_eligible=True, link_to_new_grant=None)

if grant_filters:
Expand Down