Skip to content

Commit

Permalink
fix: handle ENTERPRISE_ALGOLIA_SEARCH_API_KEY better
Browse files Browse the repository at this point in the history
Co-authored-by: Piotr Surowiec <[email protected]>
  • Loading branch information
0x29a and Agrendalath authored Nov 17, 2023
1 parent 4d582c2 commit f020fd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion enterprise/api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def algolia_key(self, request, *args, **kwargs):
objects associated with enterprise customers that the user is linked to.
"""

if not settings.ENTERPRISE_ALGOLIA_SEARCH_API_KEY:
if not (api_key := getattr(settings, "ENTERPRISE_ALGOLIA_SEARCH_API_KEY", "")):
return Response("Algolia API key not configured", status=status.HTTP_500_INTERNAL_SERVER_ERROR)

queryset = self.queryset.filter(
Expand Down

0 comments on commit f020fd8

Please sign in to comment.