diff --git a/app/dashboard/models.py b/app/dashboard/models.py index 781f8f0d02c..3f4eb71b2b2 100644 --- a/app/dashboard/models.py +++ b/app/dashboard/models.py @@ -1162,7 +1162,6 @@ def get_quarterly_stats(self): if funded_bounties_count: total_funded_usd = funded_bounties.all().aggregate(Sum('value_in_usdt')) total_funded_hourly_rate = float(0) - #TODO: Explain to the user that we only counted Bounties that developers entered # of hours worked on hourly_rate_bounties_counted = float(0) for bounty in funded_bounties: hourly_rate = bounty.hourly_rate @@ -1171,7 +1170,6 @@ def get_quarterly_stats(self): hourly_rate_bounties_counted += 1 funded_bounty_fulfillments = [] for bounty in funded_bounties: - #TODO: Check that all bounty fulfillments have acceptance and that there are no bounties that have skipped the Acceptance in fulfillment step of workflow fulfillments = bounty.fulfillments.filter(accepted=True) for fulfillment in fulfillments: if isinstance(fulfillment, BountyFulfillment): @@ -1200,7 +1198,6 @@ def get_quarterly_stats(self): avg_hourly_rate_per_funded_bounty = 0 avg_hours_per_funded_bounty = 0 funded_fulfilled_bounties = [ - #TODO: Change this to check for terminal statuses instead? bounty for bounty in funded_bounties if bounty.status == 'done' ] num_funded_fulfilled_bounties = len(funded_fulfilled_bounties) @@ -1264,7 +1261,6 @@ def get_quarterly_stats(self): current_bounty=True, metadata__icontains=keyword, idx_status__in=['open'], - #TODO: Identify the random sampling method used, see if it sending mass emails becomes slow ).order_by('?') ) relevant_bounties = relevant_bounties[:3] diff --git a/app/retail/emails.py b/app/retail/emails.py index e2494c392c1..32bdda55fe4 100644 --- a/app/retail/emails.py +++ b/app/retail/emails.py @@ -608,7 +608,8 @@ def roundup(request): def quarterly_roundup(request): from marketing.utils import get_platform_wide_stats platform_wide_stats = get_platform_wide_stats() - response_html, _ = render_quarterly_stats(settings.CONTACT_EMAIL, platform_wide_stats) + email = settings.CONTACT_EMAIL + response_html, _ = render_quarterly_stats(email, platform_wide_stats) return HttpResponse(response_html) diff --git a/app/retail/templates/emails/quarterly_stats.html b/app/retail/templates/emails/quarterly_stats.html index d973782a594..34dee86bd16 100644 --- a/app/retail/templates/emails/quarterly_stats.html +++ b/app/retail/templates/emails/quarterly_stats.html @@ -272,15 +272,17 @@

An overview of your OSS project's stats from the last 3 months.

{% endfor %}

+ {% if user_total_funded_hours %}

{{ user_total_funded_hours | intcomma }} hours

{{ user_total_funded_usd | intcomma }} USD

-

Developers worked an average of {{ user_avg_hours_per_funded_bounty }} hours per issue on your projects. You funded a total of ${{ user_total_funded_usd | intcomma }} USD of work at an average rate of ${{ user_avg_hourly_rate_per_funded_bounty }} USD / hour..

+

Developers worked an average of {{ user_avg_hours_per_funded_bounty }} hours per issue on your projects (only applies to bounties where users entered their hours). You funded a total of ${{ user_total_funded_usd | intcomma }} USD of work at an average rate of ${{ user_avg_hourly_rate_per_funded_bounty }} USD / hour..

+ {% endif %}
{% trans "Share my stats" %}