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

add checkout_type enum #7648

Merged
merged 2 commits into from
Oct 12, 2020
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
18 changes: 18 additions & 0 deletions app/grants/migrations/0089_contribution_checkout_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.4 on 2020-10-12 08:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('grants', '0088_auto_20200924_1536'),
]

operations = [
migrations.AddField(
model_name='contribution',
name='checkout_type',
field=models.CharField(blank=True, choices=[('eth_std', 'eth_std'), ('eth_zksync_deposit', 'eth_zksync_deposit'), ('eth_zksync_batch_deposit', 'eth_zksync_batch_deposit'), ('eth_zksync_pure', 'eth_zksync_pure'), ('zcash_std', 'zcash_std')], help_text='The checkout method used while making the contribution', max_length=30, null=True),
),
]
15 changes: 15 additions & 0 deletions app/grants/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,14 @@ class ContributionQuerySet(models.QuerySet):
class Contribution(SuperModel):
"""Define the structure of a subscription agreement."""

CHECKOUT_TYPES = [
('eth_std', 'eth_std'),
('eth_zksync_deposit', 'eth_zksync_deposit'),
('eth_zksync_batch_deposit', 'eth_zksync_batch_deposit'),
('eth_zksync_pure', 'eth_zksync_pure'),
('zcash_std', 'zcash_std')
]

success = models.BooleanField(default=True, help_text=_('Whether or not success.'))
tx_cleared = models.BooleanField(default=False, help_text=_('Whether or not tx cleared.'))
tx_override = models.BooleanField(default=False, help_text=_('Whether or not the tx success and tx_cleared have been manually overridden. If this setting is True, update_tx_status will not change this object.'))
Expand Down Expand Up @@ -1305,6 +1313,13 @@ class Contribution(SuperModel):
null=True,
blank=True,
)
checkout_type = models.CharField(
max_length=30,
null=True,
help_text=_('The checkout method used while making the contribution'),
blank=True,
choices=CHECKOUT_TYPES
)

def get_absolute_url(self):
return self.subscription.grant.url + '?tab=transactions'
Expand Down
19 changes: 19 additions & 0 deletions app/marketing/migrations/0022_auto_20201012_0825.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 2.2.4 on 2020-10-12 08:25

import datetime
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('marketing', '0021_auto_20201007_1153'),
]

operations = [
migrations.AlterField(
model_name='upcomingdate',
name='last_modified',
field=models.DateTimeField(db_index=True, default=datetime.datetime(2020, 10, 12, 8, 25, 7, 75237)),
),
]