Skip to content

Commit

Permalink
update old migration to get CI to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Apr 17, 2020
1 parent 8fd65f1 commit f361a15
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions app/dashboard/migrations/0034_data_for_old_grants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,29 @@ def record_grant_activity_helper(activity_type, grant, profile, date):
grant_logo = grant.logo.url
except:
grant_logo = None
metadata = {
'id': grant.id,
'value_in_token': '{0:.2f}'.format(grant.amount_received),
'amount_goal': '{0:.2f}'.format(grant.amount_goal),
'token_name': grant.token_symbol,
'title': grant.title,
'grant_logo': grant_logo,
'grant_url': grant.url,
'category': 'grant',
}
kwargs = {
'profile': profile,
'grant': grant,
'activity_type': activity_type,
'metadata': metadata,
'created_on': date,
}
if not activity_exists(activity_type, grant, 'grant', profile, date):
Activity.objects.create(**kwargs)

try:
metadata = {
'id': grant.id,
'value_in_token': '{0:.2f}'.format(grant.amount_received),
'amount_goal': '{0:.2f}'.format(grant.amount_goal),
'token_name': grant.token_symbol,
'title': grant.title,
'grant_logo': grant_logo,
'grant_url': grant.url,
'category': 'grant',
}
kwargs = {
'profile': profile,
'grant': grant,
'activity_type': activity_type,
'metadata': metadata,
'created_on': date,
}
if not activity_exists(activity_type, grant, 'grant', profile, date):
Activity.objects.create(**kwargs)
except:
pass

def record_subscription_activity_helper(activity_type, subscription, profile, date):
"""Registers a new activity concerning a grant subscription
Expand Down

0 comments on commit f361a15

Please sign in to comment.