Skip to content

Commit

Permalink
Returning none if no donate banner is set (#13133)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfmiranda authored Nov 18, 2024
1 parent ee6dd9d commit 0639507
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion network-api/networkapi/wagtailpages/pagemodels/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def get_donate_banner(self, request):
default_locale = Locale.get_default()
donate_banner_page = DonateBannerPage.objects.filter(locale=default_locale).first()

if not donate_banner_page:
# If there is no DonateBannerPage or no donate_banner is set, return None.
if not donate_banner_page or not donate_banner_page.donate_banner:
return None

# Check if the user has Do Not Track enabled by inspecting the DNT header.
Expand Down

0 comments on commit 0639507

Please sign in to comment.