diff --git a/app/app/fixtures/dashboard.json b/app/app/fixtures/dashboard.json index 40777fa8bfb..ad040a0c473 100644 --- a/app/app/fixtures/dashboard.json +++ b/app/app/fixtures/dashboard.json @@ -7959,8 +7959,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8027,8 +8025,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8095,8 +8091,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8163,8 +8157,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8231,8 +8223,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8299,8 +8289,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8367,8 +8355,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8435,8 +8421,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8503,8 +8487,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8571,8 +8553,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8639,8 +8619,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8707,8 +8685,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -8775,8 +8751,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -8827,8 +8801,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -8895,8 +8867,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -8963,8 +8933,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9031,8 +8999,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9099,8 +9065,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9167,8 +9131,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9235,8 +9197,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9303,8 +9263,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9371,8 +9329,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9439,8 +9395,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9507,8 +9461,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9575,8 +9527,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9643,8 +9593,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9711,8 +9659,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9779,8 +9725,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9847,8 +9791,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9915,8 +9857,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -9983,8 +9923,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -10051,8 +9989,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -10119,8 +10055,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -10187,8 +10121,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -10267,8 +10199,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": true, "trust_profile": false, @@ -10317,8 +10247,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": true, "trust_profile": false, @@ -10397,8 +10325,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": true, "trust_profile": false, diff --git a/app/app/fixtures/profiles.json b/app/app/fixtures/profiles.json index 75ff81c50f8..c827f63e229 100644 --- a/app/app/fixtures/profiles.json +++ b/app/app/fixtures/profiles.json @@ -36,8 +36,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -104,8 +102,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -172,8 +168,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -240,8 +234,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -308,8 +300,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -376,8 +366,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -444,8 +432,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -512,8 +498,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -580,8 +564,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -648,8 +630,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -716,8 +696,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -784,8 +762,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -852,8 +828,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -904,8 +878,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -972,8 +944,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1040,8 +1010,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1108,8 +1076,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1176,8 +1142,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1244,8 +1208,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1312,8 +1274,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1380,8 +1340,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1448,8 +1406,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1516,8 +1472,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1584,8 +1538,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1652,8 +1604,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1720,8 +1670,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1788,8 +1736,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1856,8 +1802,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1924,8 +1868,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -1992,8 +1934,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -2060,8 +2000,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -2128,8 +2066,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -2196,8 +2132,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": true, @@ -2264,8 +2198,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": false, "trust_profile": false, @@ -2344,8 +2276,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": true, "trust_profile": false, @@ -2394,8 +2324,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": true, "trust_profile": false, @@ -2474,8 +2402,6 @@ "slack_token": "", "custom_tagline": "", "slack_channel": "", - "discord_repos": "[]", - "discord_webhook_url": "", "suppress_leaderboard": false, "hide_profile": true, "trust_profile": false, diff --git a/app/app/urls.py b/app/app/urls.py index b13489835ca..3d88dead5e3 100644 --- a/app/app/urls.py +++ b/app/app/urls.py @@ -612,7 +612,6 @@ re_path(r'^settings/matching/?', marketing.views.matching_settings, name='matching_settings'), re_path(r'^settings/feedback/?', marketing.views.feedback_settings, name='feedback_settings'), re_path(r'^settings/slack/?', marketing.views.slack_settings, name='slack_settings'), - re_path(r'^settings/discord/?', marketing.views.discord_settings, name='discord_settings'), re_path(r'^settings/ens/?', marketing.views.ens_settings, name='ens_settings'), re_path(r'^settings/account/?', marketing.views.account_settings, name='account_settings'), re_path(r'^settings/tokens/?', marketing.views.token_settings, name='token_settings'), diff --git a/app/assets/v2/js/pages/bounty_details.js b/app/assets/v2/js/pages/bounty_details.js index 1561b28d282..f095f427200 100644 --- a/app/assets/v2/js/pages/bounty_details.js +++ b/app/assets/v2/js/pages/bounty_details.js @@ -714,8 +714,7 @@ var show_interest_modal = function() { } add_interest(document.result['pk'], { - issue_message: msg, - discord_username: $('#discord_username').length ? $('#discord_username').val() : null + issue_message: msg }).then(success => { if (success) { $(self).attr('href', '/uninterested'); diff --git a/app/assets/v2/js/pages/bounty_details2.js b/app/assets/v2/js/pages/bounty_details2.js index 2471ca03462..4b0d0b45773 100644 --- a/app/assets/v2/js/pages/bounty_details2.js +++ b/app/assets/v2/js/pages/bounty_details2.js @@ -525,8 +525,7 @@ var show_interest_modal = function() { } add_interest(document.result['pk'], { - issue_message: msg, - discord_username: $('#discord_username').length ? $('#discord_username').val() : null + issue_message: msg }).then(success => { if (success) { // $(self).attr('href', '/uninterested'); diff --git a/app/dashboard/context/hackathon.py b/app/dashboard/context/hackathon.py index af97040fa7c..bdbe35e497c 100644 --- a/app/dashboard/context/hackathon.py +++ b/app/dashboard/context/hackathon.py @@ -46,7 +46,6 @@ ], 'period' : _('April 15th, 2019 - April 30th, 2019'), 'register_link' : _('https://gitcoin.typeform.com/to/j7CSbV'), - 'discord_link' : _('https://discord.gg/TxRKTn8'), 'prize_link' : _('https://gitcoin.co/hackathon/ethereal-virtual-hackathon/'), 'results_link' : _('https://medium.com/gitcoin/the-results-msft-gitcoins-ethereal-hackathon-30f5ed05757e'), 'starter_guide' : _('https://medium.com/gitcoin/ethereal-virtual-hackathon-get-started-92084f05d9ee'), @@ -181,7 +180,6 @@ ], 'period' : _('June 24th, 2019 - July 10th, 2019'), 'register_link' : _('https://gitcoin.typeform.com/to/Yp7chL'), - 'discord_link' : _('https://discord.gg/TxRKTn8'), 'prize_link' : _('https://gitcoin.co/hackathon/beyondblockchain/'), 'results_link' : False, 'starter_guide' : False, diff --git a/app/dashboard/export.py b/app/dashboard/export.py index d2fdaff69cf..cd146c05a69 100644 --- a/app/dashboard/export.py +++ b/app/dashboard/export.py @@ -42,7 +42,6 @@ def to_representation(self, instance): '_locations': instance.locations, 'organizations': instance.get_who_works_with(network=None), '_email': instance.email, - '_gitcoin_discord_username': instance.gitcoin_discord_username, '_pref_lang_code': instance.pref_lang_code, '_preferred_payout_address': instance.preferred_payout_address, 'persona': instance.selected_persona or instance.dominant_persona, diff --git a/app/dashboard/helpers.py b/app/dashboard/helpers.py index e505609d7cb..a1e35ae85a0 100644 --- a/app/dashboard/helpers.py +++ b/app/dashboard/helpers.py @@ -38,8 +38,8 @@ HackathonEvent, UserAction, ) from dashboard.notifications import ( - maybe_market_to_email, maybe_market_to_github, maybe_market_to_slack, maybe_market_to_user_discord, - maybe_market_to_user_slack, notify_of_lowball_bounty, + maybe_market_to_email, maybe_market_to_github, maybe_market_to_slack, maybe_market_to_user_slack, + notify_of_lowball_bounty, ) from dashboard.tokens import addr_to_token from economy.utils import ConversionRateNotFoundError, convert_amount @@ -961,7 +961,6 @@ def process_bounty_changes(old_bounty, new_bounty): print("============ posting ==============") did_post_to_slack = maybe_market_to_slack(new_bounty, event_name) did_post_to_user_slack = maybe_market_to_user_slack(new_bounty, event_name) - did_post_to_user_discord = maybe_market_to_user_discord(new_bounty, event_name) did_post_to_github = maybe_market_to_github(new_bounty, event_name, profile_pairs) did_post_to_email = maybe_market_to_email(new_bounty, event_name) print("============ done posting ==============") @@ -973,7 +972,6 @@ def process_bounty_changes(old_bounty, new_bounty): 'did_post_to_github': did_post_to_github, 'did_post_to_slack': did_post_to_slack, 'did_post_to_user_slack': did_post_to_user_slack, - 'did_post_to_user_discord': did_post_to_user_discord, 'did_post_to_twitter': False, } diff --git a/app/dashboard/migrations/0101_auto_20200420_1427.py b/app/dashboard/migrations/0101_auto_20200420_1427.py new file mode 100644 index 00000000000..aa02379877a --- /dev/null +++ b/app/dashboard/migrations/0101_auto_20200420_1427.py @@ -0,0 +1,25 @@ +# Generated by Django 2.2.4 on 2020-04-20 14:27 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0100_delete_refundfeerequest'), + ] + + operations = [ + migrations.RemoveField( + model_name='profile', + name='discord_repos', + ), + migrations.RemoveField( + model_name='profile', + name='discord_webhook_url', + ), + migrations.RemoveField( + model_name='profile', + name='gitcoin_discord_username', + ), + ] diff --git a/app/dashboard/models.py b/app/dashboard/models.py index 4810c96a2b6..3c89f14cd1a 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -2532,9 +2532,6 @@ class Profile(SuperModel): slack_token = models.CharField(max_length=255, default='', blank=True) custom_tagline = models.CharField(max_length=255, default='', blank=True) slack_channel = models.CharField(max_length=255, default='', blank=True) - gitcoin_discord_username = models.CharField(max_length=255, default='', blank=True) - discord_repos = ArrayField(models.CharField(max_length=200), blank=True, default=list) - discord_webhook_url = models.CharField(max_length=400, default='', blank=True) suppress_leaderboard = models.BooleanField( default=False, help_text='If this option is chosen, we will remove your profile information from the leaderboard', @@ -3658,35 +3655,6 @@ def update_slack_integration(self, token, channel, repos): self.slack_channel = channel self.save() - def get_discord_repos(self, join=False): - """Get the profile's Discord tracked repositories. - - Args: - join (bool): Whether or not to return a joined string representation. - Defaults to: False. - - Returns: - list of str: If joined is False, a list of discord repositories. - str: If joined is True, a combined string of discord repositories. - - """ - if join: - repos = ', '.join(self.discord_repos) - return repos - return self.discord_repos - - def update_discord_integration(self, webhook_url, repos): - """Update the profile's Discord integration settings. - - Args: - webhook_url (str): The profile's Discord webhook url. - repos (list of str): The profile's github repositories to track. - - """ - repos = repos.split(',') - self.discord_webhook_url = webhook_url - self.discord_repos = [repo.strip() for repo in repos] - self.save() @staticmethod def get_network(): diff --git a/app/dashboard/notifications.py b/app/dashboard/notifications.py index 2c0b3c5124d..0103902fcc8 100644 --- a/app/dashboard/notifications.py +++ b/app/dashboard/notifications.py @@ -225,7 +225,7 @@ def maybe_market_to_slack(bounty, event_name): def build_message_for_integration(bounty, event_name): - """Build message to be posted to integrated service (e.g. slack, discord). + """Build message to be posted to integrated service (e.g. slack). Args: bounty (dashboard.models.Bounty): The Bounty to be marketed. @@ -306,55 +306,6 @@ def maybe_market_to_user_slack_helper(bounty, event_name): return sent -def maybe_market_to_user_discord(bounty, event_name): - from dashboard.tasks import maybe_market_to_user_discord - maybe_market_to_user_discord.delay(bounty.pk, event_name) - - -def maybe_market_to_user_discord_helper(bounty, event_name): - """Send a Discord message to the user's discord channel for the specified Bounty. - - Args: - bounty (dashboard.models.Bounty): The Bounty to be marketed. - event_name (str): The name of the event. - - Returns: - bool: Whether or not the Discord notification was sent successfully. - - """ - from dashboard.models import Profile - if bounty.get_natural_value() < 0.0001: - return False - if bounty.network != settings.ENABLE_NOTIFICATIONS_ON_NETWORK: - return False - - msg = build_message_for_integration(bounty, event_name) - if not msg: - return False - - url = bounty.github_url - sent = False - try: - repo = org_name(url) + '/' + repo_name(url) - subscribers = Profile.objects.filter(discord_repos__contains=[repo]) - subscribers = subscribers & Profile.objects.exclude(discord_webhook_url='') - for subscriber in subscribers: - try: - headers = {'Content-Type': 'application/json'} - body = {"content": msg, "avatar_url": static('v2/images/helmet.png')} - discord_response = requests.post( - subscriber.discord_webhook_url, headers=headers, json=body - ) - if discord_response.status_code == 204: - sent = True - except Exception as e: - print(e) - except Exception as e: - print(e) - - return sent - - def maybe_market_tip_to_email(tip, emails): """Send an email for the specified Tip. diff --git a/app/dashboard/tasks.py b/app/dashboard/tasks.py index 2fcd7e28131..9f79c571a30 100644 --- a/app/dashboard/tasks.py +++ b/app/dashboard/tasks.py @@ -112,19 +112,6 @@ def maybe_market_to_user_slack(self, bounty_pk, event_name, retry: bool = True) maybe_market_to_user_slack_helper(bounty, event_name) -@app.shared_task(bind=True) -def maybe_market_to_user_discord(self, bounty_pk, event_name, retry: bool = True) -> None: - """ - :param self: - :param bounty_pk: - :param event_name: - :return: - """ - with redis.lock("maybe_market_to_user_discord:bounty", timeout=LOCK_TIMEOUT): - bounty = Bounty.objects.get(pk=bounty_pk) - from dashboard.notifications import maybe_market_to_user_discord_helper - maybe_market_to_user_discord_helper(bounty, event_name) - @app.shared_task(bind=True, max_retries=3) def grant_update_email_task(self, pk, retry: bool = True) -> None: """ diff --git a/app/dashboard/templates/dashboard/hackathon/index.html b/app/dashboard/templates/dashboard/hackathon/index.html index ed5719aa403..2ec86a401c4 100644 --- a/app/dashboard/templates/dashboard/hackathon/index.html +++ b/app/dashboard/templates/dashboard/hackathon/index.html @@ -44,9 +44,6 @@
- {% if discord_link %} -
- {% endif %} {% if prize_link %} {% endif %} diff --git a/app/dashboard/templates/profiles/header_details.html b/app/dashboard/templates/profiles/header_details.html index f72bbbdc628..71f310b1423 100644 --- a/app/dashboard/templates/profiles/header_details.html +++ b/app/dashboard/templates/profiles/header_details.html @@ -91,11 +91,6 @@