Skip to content

Commit

Permalink
Merge pull request #6295 from gitcoinco/kevin/matchboolean
Browse files Browse the repository at this point in the history
    ability to toggle on/off matching for individual contribs in admin
  • Loading branch information
owocki authored Mar 24, 2020
2 parents 3a573ca + 7bdad08 commit 63366d0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/grants/clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def populate_data_for_clr(clr_type=None, network='mainnet'):

from_date = timezone.now()
# get all the eligible contributions and calculate total
contributions = Contribution.objects.prefetch_related('subscription').filter(created_on__gte=CLR_START_DATE, created_on__lte=from_date, success=True)
contributions = Contribution.objects.prefetch_related('subscription').filter(match=True, created_on__gte=CLR_START_DATE, created_on__lte=from_date, success=True)

if clr_type == 'tech':
grants = Grant.objects.filter(network=network, hidden=False, active=True, grant_type='tech', link_to_new_grant=None)
Expand Down
23 changes: 23 additions & 0 deletions app/grants/migrations/0048_auto_20200324_1829.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.2.4 on 2020-03-24 18:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('grants', '0047_auto_20200323_1724'),
]

operations = [
migrations.AddField(
model_name='contribution',
name='match',
field=models.BooleanField(default=True, help_text='Whether or not this contribution should be matched.'),
),
migrations.AlterField(
model_name='grant',
name='categories',
field=models.ManyToManyField(blank=True, to='grants.GrantCategory'),
),
]
1 change: 1 addition & 0 deletions app/grants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,7 @@ class Contribution(SuperModel):
blank=True,
help_text=_('the normalized grant data; for easy consumption on read'),
)
match = models.BooleanField(default=True, help_text=_('Whether or not this contribution should be matched.'))

def __str__(self):
"""Return the string representation of this object."""
Expand Down

0 comments on commit 63366d0

Please sign in to comment.