Skip to content
Merged
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: 4 additions & 0 deletions apps/api/plane/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,3 +465,7 @@
REST_FRAMEWORK["DEFAULT_SCHEMA_CLASS"] = "drf_spectacular.openapi.AutoSchema"
INSTALLED_APPS.append("drf_spectacular")
from .openapi import SPECTACULAR_SETTINGS # noqa: F401

# MongoDB Settings
MONGO_DB_URL = os.environ.get("MONGO_DB_URL", False)
MONGO_DB_DATABASE = os.environ.get("MONGO_DB_DATABASE", False)
3 changes: 3 additions & 0 deletions apps/api/plane/settings/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,7 @@ def is_configured(cls) -> bool:
Returns:
bool: True if MongoDB is configured and connected, False otherwise
"""

if cls._client is None:
cls._instance = cls()
Comment on lines +122 to +123
Copy link

Copilot AI Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code sets cls._instance but doesn't assign the result to cls._client or cls._db. This means the initialization won't actually populate the client/database attributes that are checked in the return statement. You should either call a method that properly initializes these attributes or ensure the constructor properly sets cls._client and cls._db.

Suggested change
if cls._client is None:
cls._instance = cls()
if cls._client is None or cls._db is None:
cls._initialize_connection()

Copilot uses AI. Check for mistakes.
return cls._client is not None and cls._db is not None
Loading