Skip to content

Commit

Permalink
Beta: fix dashboard when user doesn't have projects (#11352)
Browse files Browse the repository at this point in the history
  • Loading branch information
stsewd authored May 27, 2024
1 parent 62eb3f1 commit 06daf9f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion readthedocs/projects/views/private.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ def get_context_data(self, **kwargs):
template_name = None
projects = AdminPermission.projects(user=self.request.user, admin=True)
n_projects = projects.count()
if n_projects < 3 and (timezone.now() - projects.first().pub_date).days < 7:
if n_projects == 0 or (
n_projects < 3 and (timezone.now() - projects.first().pub_date).days < 7
):
template_name = "example-projects.html"
elif (
n_projects
Expand Down

0 comments on commit 06daf9f

Please sign in to comment.