Skip to content

Commit

Permalink
Merge pull request #4628 from thelostone-mc/master
Browse files Browse the repository at this point in the history
fixed conflicts
  • Loading branch information
octavioamu authored Jun 12, 2019
2 parents 0a83ed3 + 6da0caa commit 7f65245
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/dashboard/tests/test_users_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ def setUp(self):
def test_user_list(self):
request = self.request
request.user = self.current_user
assert json.loads(users_fetch(request.get('/api/v0.1/users_fetch/')).content)['count'] == 21
assert json.loads(users_fetch(request.get('/api/v0.1/users_fetch?user={}'.format(self.current_user.id))).content)['count'] == 21
31 changes: 17 additions & 14 deletions app/grants/migrations/0023_auto_20190604_1552.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ def forwards(apps, schema_editor):
## ROUND 2 CLR Match Amounts
from grants.models import CLRMatch
# array of [grant_id, amount]
data = [(82,13548),(89,11728),(24,3499),(39,3450),(80,2762),(48,2346),(25,2085),(20,1428),(13,1245),(36,910),(37,868),(40,774),(49,765),(85,725),(21,720),(12,530),(32,527),(30,354),(29,301),(16,265),(86,261),(38,158),(65,157),(17,150),(47,119),(81,100),(99,59),(23,56),(35,28),(62,24),(41,16),(50,15),(43,13),(31,10),(74,2),(76,2),(26,0),(87,0),(15,0),(73,0),(63,0),(79,0),(66,0),(72,0),(92,0),(83,0)]
round_number = 2
for ele in data:
grant = Grant.objects.get(pk=ele[0])
amount = ele[1]
if amount:
grant.clr_matching += amount
grant.save()
if grant.clr_matching:
CLRMatch.objects.create(
grant=grant,
round_number=round_number,
amount=amount,
)
try:
data = [(82,13548),(89,11728),(24,3499),(39,3450),(80,2762),(48,2346),(25,2085),(20,1428),(13,1245),(36,910),(37,868),(40,774),(49,765),(85,725),(21,720),(12,530),(32,527),(30,354),(29,301),(16,265),(86,261),(38,158),(65,157),(17,150),(47,119),(81,100),(99,59),(23,56),(35,28),(62,24),(41,16),(50,15),(43,13),(31,10),(74,2),(76,2),(26,0),(87,0),(15,0),(73,0),(63,0),(79,0),(66,0),(72,0),(92,0),(83,0)]
round_number = 2
for ele in data:
grant = Grant.objects.get(pk=ele[0])
amount = ele[1]
if amount:
grant.clr_matching += amount
grant.save()
if grant.clr_matching:
CLRMatch.objects.create(
grant=grant,
round_number=round_number,
amount=amount,
)
except Exception as e:
logger.info(e)

def backwards(apps, schema_editor):
pass
Expand Down
18 changes: 18 additions & 0 deletions app/grants/migrations/0024_auto_20190612_1645.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.7 on 2019-06-12 16:45

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('grants', '0023_auto_20190604_1552'),
]

operations = [
migrations.AlterField(
model_name='grant',
name='clr_matching',
field=models.DecimalField(decimal_places=2, default=0, help_text='The TOTAL CLR matching amount across all rounds', max_digits=20),
),
]
5 changes: 2 additions & 3 deletions app/grants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
from django.contrib.postgres.fields import ArrayField, JSONField
from django.db import models
from django.db.models import Q
from django.db.models.signals import pre_save
from django.dispatch import receiver
from django.utils import timezone
from django.utils.timezone import localtime
from django.utils.translation import gettext_lazy as _
Expand Down Expand Up @@ -700,8 +702,6 @@ def successful_contribution(self, tx_id):
return contribution


<<<<<<< Updated upstream
=======
@receiver(pre_save, sender=Grant, dispatch_uid="psave_grant")
def psave_grant(sender, instance, **kwargs):

Expand All @@ -719,7 +719,6 @@ def psave_grant(sender, instance, **kwargs):
#print("-", subscription.id, value_usdt, instance.monthly_amount_subscribed )


>>>>>>> Stashed changes
class ContributionQuerySet(models.QuerySet):
"""Define the Contribution default queryset and manager."""

Expand Down

0 comments on commit 7f65245

Please sign in to comment.