Skip to content

Commit f7d8da3

Browse files
author
julioest
committed
fix: Filter out deleted stub authors
Prefer authors with GitHub usernames for avatar display, falling back to any non-deleted author.
1 parent 16c6e86 commit f7d8da3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

core/views.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ def get_context_data(self, **kwargs):
17331733

17341734
demo_library_items = []
17351735
demo_libs_qs = Library.objects.filter(
1736-
slug__in=["accumulators", "filesystem", "asio", "geometry", "beast"]
1736+
slug__in=["accumulators", "mysql", "asio", "geometry", "beast"]
17371737
).prefetch_related("categories", "authors")
17381738
for lib in demo_libs_qs:
17391739
lv = (
@@ -1745,7 +1745,11 @@ def get_context_data(self, **kwargs):
17451745
{"label": cat.name, "url": "#", "variant": "neutral"}
17461746
for cat in lib.categories.all()[:3]
17471747
]
1748-
author = lib.authors.first()
1748+
author = (
1749+
lib.authors.exclude(email__startswith="deleted-")
1750+
.exclude(github_username="")
1751+
.first()
1752+
) or lib.authors.exclude(email__startswith="deleted-").first()
17491753
demo_library_items.append(
17501754
{
17511755
"library_name": lib.display_name_short,

0 commit comments

Comments
 (0)