-
-
Notifications
You must be signed in to change notification settings - Fork 775
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4695 - Bounty request when nothing has been found
- Loading branch information
Showing
11 changed files
with
157 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
app/bounty_requests/migrations/0003_bountyrequest_github_org_name.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.1.7 on 2019-09-24 20:22 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bounty_requests', '0002_auto_20181226_1716'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='bountyrequest', | ||
name='github_org_name', | ||
field=models.CharField(default='', max_length=50), | ||
), | ||
] |
18 changes: 18 additions & 0 deletions
18
app/bounty_requests/migrations/0004_bountyrequest_github_org_email.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 2.1.7 on 2019-09-24 20:57 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bounty_requests', '0003_bountyrequest_github_org_name'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='bountyrequest', | ||
name='github_org_email', | ||
field=models.CharField(default='', max_length=255), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,16 +30,16 @@ | |
from python_http_client.exceptions import HTTPError, UnauthorizedError | ||
from retail.emails import ( | ||
render_admin_contact_funder, render_bounty_changed, render_bounty_expire_warning, render_bounty_feedback, | ||
render_bounty_startwork_expire_warning, render_bounty_unintersted, render_faucet_rejected, render_faucet_request, | ||
render_featured_funded_bounty, render_funder_payout_reminder, render_funder_stale, render_gdpr_reconsent, | ||
render_gdpr_update, render_grant_cancellation_email, render_kudos_email, render_match_email, render_new_bounty, | ||
render_new_bounty_acceptance, render_new_bounty_rejection, render_new_bounty_roundup, render_new_grant_email, | ||
render_new_supporter_email, render_new_work_submission, render_no_applicant_reminder, render_nth_day_email_campaign, | ||
render_quarterly_stats, render_reserved_issue, render_share_bounty, render_start_work_applicant_about_to_expire, | ||
render_start_work_applicant_expired, render_start_work_approved, render_start_work_new_applicant, | ||
render_start_work_rejected, render_subscription_terminated_email, render_successful_contribution_email, | ||
render_support_cancellation_email, render_thank_you_for_supporting_email, render_tip_email, | ||
render_unread_notification_email_weekly_roundup, render_weekly_recap, | ||
render_bounty_request, render_bounty_startwork_expire_warning, render_bounty_unintersted, render_faucet_rejected, | ||
render_faucet_request, render_featured_funded_bounty, render_funder_payout_reminder, render_funder_stale, | ||
render_gdpr_reconsent, render_gdpr_update, render_grant_cancellation_email, render_kudos_email, render_match_email, | ||
render_new_bounty, render_new_bounty_acceptance, render_new_bounty_rejection, render_new_bounty_roundup, | ||
render_new_grant_email, render_new_supporter_email, render_new_work_submission, render_no_applicant_reminder, | ||
render_nth_day_email_campaign, render_quarterly_stats, render_reserved_issue, render_share_bounty, | ||
render_start_work_applicant_about_to_expire, render_start_work_applicant_expired, render_start_work_approved, | ||
render_start_work_new_applicant, render_start_work_rejected, render_subscription_terminated_email, | ||
render_successful_contribution_email, render_support_cancellation_email, render_thank_you_for_supporting_email, | ||
render_tip_email, render_unread_notification_email_weekly_roundup, render_weekly_recap, | ||
) | ||
from sendgrid.helpers.mail import Content, Email, Mail, Personalization | ||
from sendgrid.helpers.stats import Category | ||
|
@@ -1093,20 +1093,33 @@ def new_bounty_request(model): | |
to_email = '[email protected]' | ||
from_email = model.requested_by.email or settings.SERVER_EMAIL | ||
cur_language = translation.get_language() | ||
|
||
try: | ||
setup_lang(to_email) | ||
subject = _("New Bounty Request") | ||
body_str = _("New Bounty Request from") | ||
body = f"{body_str} {model.requested_by}: "\ | ||
f"{settings.BASE_URL}_administrationbounty_requests/bountyrequest/{model.pk}/change" | ||
html, text, subject = render_bounty_request(to_email, model, settings.BASE_URL) | ||
|
||
send_mail( | ||
from_email, | ||
to_email, | ||
subject, | ||
body, | ||
text, | ||
html, | ||
from_name=_("No Reply from Gitcoin.co"), | ||
categories=['admin', 'new_bounty_request'], | ||
) | ||
|
||
if model.github_org_email != '': | ||
to_email = model.github_org_email | ||
setup_lang(to_email) | ||
send_mail( | ||
from_email, | ||
to_email, | ||
subject, | ||
text, | ||
html, | ||
from_name=_("No Reply from Gitcoin.co"), | ||
categories=['admin', 'new_bounty_request'], | ||
) | ||
finally: | ||
translation.activate(cur_language) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{% extends 'emails/template.html' %} | ||
{% comment %} | ||
Copyright (C) 2018 Gitcoin Core | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
|
||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
{% endcomment %} | ||
{% load i18n humanize %} | ||
{% load static %} | ||
{% block content %} | ||
<h1>{% trans "New Bounty Request" %}</h1> | ||
<div style="text-align: left! important"> | ||
<p>{% trans "New Gitcoin bounty funding request from" %} {{model.requested_by.github_url}}:</p> | ||
<br/> | ||
<p>{% trans "Link to the issue" %}: {{model.github_url}}.</p> | ||
<br/> | ||
<p>{% trans "The user proposes funding of" %} {{model.amount}} ({% trans "USD" %}) {% trans "and has attached the following comment along with the funding request" %}:</p> | ||
<p>"{{model.comment}}"</p> | ||
<br/> | ||
<p>{% trans "Should you wish to fund the aforementioned issue, you can follow this URL" %}:</p> | ||
<a href="{{base_url}}bounty/new?invite={{model.requested_by.pk}}&source={{model.github_url}}">{{base_url}}bounty/new?invite={{model.requested_by.pk}}&source={{model.github_url}}</a> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
New Gitcoin bounty funding request from {{model.requested_by.github_url}}}: | ||
|
||
Link to the issue: {{model.github_url}}. | ||
|
||
The user proposes funding of {{model.amount}} (USD) and has attached the following comment along with the funding request: | ||
"{{model.comment}}" | ||
|
||
Should you wish to fund the aforementioned issue, you can follow this URL: | ||
{{settings.BASE_URL}}bounty/new?invite={{model.requested_by.pk}}&source={{model.github_url}} |