From 184092282aaf98320e92b4d1fb57094e851dc708 Mon Sep 17 00:00:00 2001 From: Anthony Date: Wed, 24 Apr 2024 03:38:56 -0700 Subject: [PATCH] Use initial value for default dashboard template name (#11298) --- readthedocs/projects/views/private.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/readthedocs/projects/views/private.py b/readthedocs/projects/views/private.py index b9b5dd0054b..8447095e8cd 100644 --- a/readthedocs/projects/views/private.py +++ b/readthedocs/projects/views/private.py @@ -116,6 +116,7 @@ def get_context_data(self, **kwargs): projects = AdminPermission.projects(user=self.request.user, admin=True) n_projects = projects.count() + template_name = "security-logs.html" if n_projects < 3 and (timezone.now() - projects.first().pub_date).days < 7: template_name = "example-projects.html" elif ( @@ -128,8 +129,6 @@ def get_context_data(self, **kwargs): and not projects.filter(addons__analytics_enabled=True).exists() ): template_name = "traffic-analytics.html" - else: - context["promotion"] = "security-logs.html" context["promotion"] = f"projects/partials/dashboard/{template_name}"