From aadea2db1490caf97e84e621552bec3358f09eae Mon Sep 17 00:00:00 2001 From: Arkadii Yakovets Date: Tue, 1 Oct 2024 10:50:47 -0700 Subject: [PATCH] Update issue index and Nginx config --- backend/apps/github/models/issue.py | 5 ++++- backend/apps/github/models/managers/issue.py | 3 +++ nginx/staging.conf | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/apps/github/models/issue.py b/backend/apps/github/models/issue.py index 97dd2b6..f87ccdc 100644 --- a/backend/apps/github/models/issue.py +++ b/backend/apps/github/models/issue.py @@ -92,7 +92,10 @@ def __str__(self): def is_indexable(self): """Issues to index.""" return ( - self.state == self.State.OPEN and not self.is_locked and self.repository.is_indexable + self.state == self.State.OPEN + and not self.is_locked + and not self.assignees.exists() + and self.repository.is_indexable ) @property diff --git a/backend/apps/github/models/managers/issue.py b/backend/apps/github/models/managers/issue.py index a3a741d..844a605 100644 --- a/backend/apps/github/models/managers/issue.py +++ b/backend/apps/github/models/managers/issue.py @@ -18,6 +18,9 @@ def get_queryset(self): .select_related( "repository", ) + .prefetch_related( + "assignees", + ) .filter( repository__project__isnull=False, state="open", diff --git a/nginx/staging.conf b/nginx/staging.conf index 14a19fc..7d04a58 100644 --- a/nginx/staging.conf +++ b/nginx/staging.conf @@ -23,7 +23,7 @@ server { } server { - listen 443 ssl; + listen 443 ssl default_server; server_name _; ssl_certificate /etc/letsencrypt/live/nest.owasp.dev/fullchain.pem;