Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/apps/github/models/mixins/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from django.utils.text import Truncator

DESCRIPTION_MAX_LENGTH = 1000


class ReleaseIndexMixin:
"""Release index mixin."""
Expand Down Expand Up @@ -37,7 +39,7 @@ def idx_created_at(self) -> float:
@property
def idx_description(self) -> str:
"""Return description for indexing."""
return Truncator(self.description).chars(1000, truncate="...")
return Truncator(self.description).chars(DESCRIPTION_MAX_LENGTH, truncate="...")

@property
def idx_is_pre_release(self) -> bool:
Expand Down
3 changes: 2 additions & 1 deletion backend/apps/owasp/models/mixins/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
ISSUES_LIMIT = 6
RELEASES_LIMIT = 4
REPOSITORIES_LIMIT = 4
DEFAULT_HEALTH_SCORE = 100


class ProjectIndexMixin(RepositoryBasedEntityModelMixin):
Expand Down Expand Up @@ -40,7 +41,7 @@ def idx_forks_count(self) -> int:
def idx_health_score(self) -> float | None:
"""Return health score for indexing."""
# TODO(arkid15r): Enable real health score in production when ready.
return 100 if settings.IS_PRODUCTION_ENVIRONMENT else self.health_score
return DEFAULT_HEALTH_SCORE if settings.IS_PRODUCTION_ENVIRONMENT else self.health_score

@property
def idx_is_active(self) -> bool:
Expand Down