diff --git a/app/assets/v2/css/grants/profile.css b/app/assets/v2/css/grants/profile.css index a567afaa55a..26717e09265 100644 --- a/app/assets/v2/css/grants/profile.css +++ b/app/assets/v2/css/grants/profile.css @@ -70,5 +70,20 @@ h2.title { .title { padding-left: 10px; } +} + +.verification__warning { + background-color: #f8f8f0; + border: 2px solid #ffce08; + color: #b88b16; + font-weight: bold; +} -} \ No newline at end of file +.verification__warning__icon { + font-size: 1.8rem; + margin-top: 7px; +} + +.error { + color: var(--gc-pink); +} diff --git a/app/grants/admin.py b/app/grants/admin.py index 9341ea0fe18..1edf802317a 100644 --- a/app/grants/admin.py +++ b/app/grants/admin.py @@ -95,7 +95,7 @@ class GrantAdmin(GeneralAdmin): 'subscriptions_links', 'contributions_links', 'logo', 'logo_svg', 'image_css', 'link', 'clr_prediction_curve', 'hidden', 'grant_type', 'next_clr_calc_date', 'last_clr_calc_date', 'metadata', 'categories', 'twitter_handle_1', 'twitter_handle_2', 'view_count', 'is_clr_eligible', 'in_active_clrs', - 'last_update', 'funding_info' + 'last_update', 'funding_info', 'twitter_verified', 'twitter_verified_by', 'twitter_verified_at' ] readonly_fields = [ 'logo_svg_asset', 'logo_asset', diff --git a/app/grants/migrations/0080_auto_20200914_2146.py b/app/grants/migrations/0080_auto_20200914_2146.py new file mode 100644 index 00000000000..4b02eb1674b --- /dev/null +++ b/app/grants/migrations/0080_auto_20200914_2146.py @@ -0,0 +1,30 @@ +# Generated by Django 2.2.4 on 2020-09-14 21:46 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0148_add_brightid_status'), + ('grants', '0079_auto_20200914_2031'), + ] + + operations = [ + migrations.AddField( + model_name='grant', + name='twitter_verified', + field=models.BooleanField(default=False, help_text='The owner grant has verified the twitter account'), + ), + migrations.AddField( + model_name='grant', + name='twitter_verified_at', + field=models.DateTimeField(blank=True, help_text='At what time and date what verified this grant', null=True), + ), + migrations.AddField( + model_name='grant', + name='twitter_verified_by', + field=models.ForeignKey(blank=True, help_text='Team member who verified this grant', null=True, on_delete=django.db.models.deletion.SET_NULL, to='dashboard.Profile'), + ), + ] diff --git a/app/grants/models.py b/app/grants/models.py index 3a4f229e90b..4249a0631bf 100644 --- a/app/grants/models.py +++ b/app/grants/models.py @@ -371,6 +371,10 @@ class Meta: is_clr_active = models.BooleanField(default=False, help_text=_('CLR Round active or not? (auto computed)')) clr_round_num = models.CharField(default='', max_length=255, help_text=_('the CLR round number thats active'), blank=True) + twitter_verified = models.BooleanField(default=False, help_text='The owner grant has verified the twitter account') + twitter_verified_by = models.ForeignKey('dashboard.Profile', null=True, blank=True, on_delete=models.SET_NULL, help_text='Team member who verified this grant') + twitter_verified_at = models.DateTimeField(blank=True, null=True, help_text='At what time and date what verified this grant') + # Grant Query Set used as manager. objects = GrantQuerySet.as_manager() @@ -1259,38 +1263,38 @@ def update_tx_status(self): # We use the transaction hashes of this object to help identify zkSync checkouts. This # works as follows: - # + # # self.split_tx_id holds one of: - # Case 1: The tx hash of an L1 transaction to the BulkCheckout contract for an + # Case 1: The tx hash of an L1 transaction to the BulkCheckout contract for an # ordinary checkout # Case 2: The tx hash of an L1 transaction that deposits funds into zkSync. This # occurs when a user did not have existing funds in zkSync # Case 3: The address of the Gitcoin zkSync wallet that executed the donations. This # occurs when a user already had funds in zkSync - # + # # Case 1 has already been handled by everything above. For Case 2, we mark a # contribution as cleared once both of the below conditions are met: # 1. The L1 deposit transaction has been confirmed, and # 2. The L2 transfers have been completed # # For case 3, we mark a contribution as cleared once the L2 transfers are completed. - + # Prepare web3 provider network = self.subscription.network PROVIDER = "wss://" + network + ".infura.io/ws/v3/" + settings.INFURA_V3_PROJECT_ID w3 = Web3(Web3.WebsocketProvider(PROVIDER)) - + # Get case number is_split_tx_id_address = len(self.split_tx_id) == 42 and self.split_tx_id[0:2] == '0x' if is_split_tx_id_address: case_number = 3 - + else: # Figure out if we are in Case 1 or Case 2 # handle replace of split_tx_id if not self.split_tx_id: return - + split_tx_status, _ = get_tx_status(self.split_tx_id, self.subscription.network, self.created_on) if split_tx_status in ['pending', 'dropped', 'unknown', '']: new_tx = getReplacedTX(self.split_tx_id) @@ -1311,7 +1315,7 @@ def update_tx_status(self): batch_zksync_deposit_contract_addr = '0x9D37F793E5eD4EbD66d62D505684CD9f756504F6'.lower() zkSync_recipients = [zksync_contract_addr.lower(), batch_zksync_deposit_contract_addr.lower()] case_number = 2 if recipient_L1 in zkSync_recipients else 1 - + # If case 1, proceed as normal if case_number == 1: # actually validate token transfers diff --git a/app/grants/templates/grants/components/card.html b/app/grants/templates/grants/components/card.html index 56b041abda5..0ecb957c8b4 100644 --- a/app/grants/templates/grants/components/card.html +++ b/app/grants/templates/grants/components/card.html @@ -26,6 +26,12 @@
@@ -121,6 +127,12 @@