Skip to content

Commit

Permalink
OOPS!
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelmdLow committed Oct 22, 2024
1 parent b82d8b6 commit 1d5cd01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions authors/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def organize_media(self, media_type, request, context):
# Get articles where this author is credited with something other than "author" and "org_role"
authors_media = []
keys = []
for a in ArticleAuthorsOrderable.objects.filter(author=self).exclude(Q(author_role="author") | Q(author_role="org_role")).order_by(article_order+'article_page__explicit_published_at'):
for a in ArticleAuthorsOrderable.objects.filter(author=self, article_page__live=True).exclude(Q(author_role="author") | Q(author_role="org_role")).order_by(article_order+'article_page__explicit_published_at'):
# we gotta do this because I can't use .distinct() on a field with mysql. We have to move to postgres for that (sounds like a lot of work) - samlow 21/10/2024
if not a.article_page_id in keys:
keys.append(a.article_page_id)
Expand All @@ -206,7 +206,7 @@ def organize_media(self, media_type, request, context):
# Get articles where this author is creditted with either "author" or "org_role"
authors_media = []
keys = []
for a in ArticleAuthorsOrderable.objects.filter(Q(author=self, author_role="author") | Q(author=self, author_role="org_role")).order_by(article_order+'article_page__explicit_published_at'):
for a in ArticleAuthorsOrderable.objects.filter(Q(author=self, author_role="author", article_page__live=True) | Q(author=self, author_role="org_role", article_page__live=True)).order_by(article_order+'article_page__explicit_published_at'):
# same here, can't use .distinct() cause not using postgres - samlow 21/10/2024
if not a.article_page_id in keys:
keys.append(a.article_page_id)
Expand Down

0 comments on commit 1d5cd01

Please sign in to comment.