diff --git a/aggregator/context_processors.py b/aggregator/context_processors.py index 36b1bcfbe..2bc2de6d0 100644 --- a/aggregator/context_processors.py +++ b/aggregator/context_processors.py @@ -12,5 +12,5 @@ def community_stats(request): Context processor to calculate Django's age for the community pages. """ # Django 3.2 introduces depth kwarg. Set timesince(..., depth=1) then. - stats = {"age": timesince(DJANGO_DOB)} + stats = {"age": timesince(DJANGO_DOB, depth=1)} return {"community_stats": stats} diff --git a/dashboard/views.py b/dashboard/views.py index 0c6238793..06dc69600 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -19,12 +19,15 @@ def index(request): if data is None: metrics = [] for MC in Metric.__subclasses__(): - metrics.extend(MC.objects.filter(show_on_dashboard=True)) + metrics.extend( + MC.objects.filter(show_on_dashboard=True).prefetch_related("data") + ) metrics = sorted(metrics, key=operator.attrgetter("display_position")) data = [] for metric in metrics: - data.append({"metric": metric, "latest": metric.data.latest()}) + latest_data = metric.data.latest() + data.append({"metric": metric, "latest": latest_data}) cache.set(key, data, 60 * 60, version=generation) return render(request, "dashboard/index.html", {"data": data}) diff --git a/djangoproject/templates/base_community.html b/djangoproject/templates/base_community.html index 294bc92eb..91663ef87 100644 --- a/djangoproject/templates/base_community.html +++ b/djangoproject/templates/base_community.html @@ -2,7 +2,7 @@ {% load fundraising_extras i18n %} {% block og_title %}{% translate "Django Community" %}{% endblock %} -{% block og_description %}{% translate "Building the Django Community. Come join us!" %}{% endblock %} +{% block og_description %}{% translate "Building the Django Community for {{ community_stats.age }} Come join us!" %}{% endblock %} {% block layout_class %}sidebar-right{% endblock %} {% block title %}{% translate "Django Community" %}{% endblock %} diff --git a/fundraising/forms.py b/fundraising/forms.py index 3127866ee..dc1768952 100644 --- a/fundraising/forms.py +++ b/fundraising/forms.py @@ -46,25 +46,11 @@ class DjangoHeroForm(forms.ModelForm): logo = forms.FileField( required=False, help_text=_( - "If you've donated at least US $%d, you can submit your logo and " + "If you've donated at least US $%d in a calendar year, you can submit your logo and " "we will display it, too." ) % LEADERSHIP_LEVEL_AMOUNT, ) - is_visible = forms.BooleanField( - required=False, - label=_( - "Yes, display my name, URL, and logo on this site. " - "It'll be displayed shortly after we verify it." - ), - ) - is_subscribed = forms.BooleanField( - required=False, - label=_( - "Yes, the Django Software Foundation can inform me about " - "future fundraising campaigns by email." - ), - ) class Meta: model = DjangoHero