Skip to content

Commit

Permalink
Use initial value for default dashboard template name (#11298)
Browse files Browse the repository at this point in the history
  • Loading branch information
agjohnson committed Apr 24, 2024
1 parent 36bc94a commit 1840922
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions readthedocs/projects/views/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -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}"

Expand Down

0 comments on commit 1840922

Please sign in to comment.