From e1238c1a49e3f13dd4ca89574e5e95f115f8e8d6 Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Fri, 9 Oct 2020 13:58:31 +0530 Subject: [PATCH 1/2] add checkout_type enum --- .../0089_contribution_checkout_type.py | 18 ++++++++++++++++++ app/grants/models.py | 15 +++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 app/grants/migrations/0089_contribution_checkout_type.py diff --git a/app/grants/migrations/0089_contribution_checkout_type.py b/app/grants/migrations/0089_contribution_checkout_type.py new file mode 100644 index 00000000000..77c924fe86c --- /dev/null +++ b/app/grants/migrations/0089_contribution_checkout_type.py @@ -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), + ), + ] diff --git a/app/grants/models.py b/app/grants/models.py index 29169dc37f1..e5c3b22559f 100644 --- a/app/grants/models.py +++ b/app/grants/models.py @@ -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.')) @@ -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' From 237f3cb680c9db415f5a221165e1086e151623ab Mon Sep 17 00:00:00 2001 From: Aditya Anand M C Date: Mon, 12 Oct 2020 13:56:00 +0530 Subject: [PATCH 2/2] add missing migration --- .../migrations/0022_auto_20201012_0825.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 app/marketing/migrations/0022_auto_20201012_0825.py diff --git a/app/marketing/migrations/0022_auto_20201012_0825.py b/app/marketing/migrations/0022_auto_20201012_0825.py new file mode 100644 index 00000000000..95db8180966 --- /dev/null +++ b/app/marketing/migrations/0022_auto_20201012_0825.py @@ -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)), + ), + ]