Skip to content

Commit cdfdea1

Browse files
committed
fix(core): bugs
1 parent 02c18f9 commit cdfdea1

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

apps/core/alembic/env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from logging.config import fileConfig
55

66
from alembic import context
7+
from core._dotenv import load_dotenv # noqa: F401
78
from core.core.config import settings
89
from core.db.models import * # noqa: F403
910
from sqlalchemy import pool

apps/core/src/core/_dotenv.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
import os
1+
from pathlib import Path
22

33
from dotenv import load_dotenv
44

5-
BASEDIR = os.path.abspath(os.path.dirname(__file__))
6-
load_dotenv(os.path.join(BASEDIR,"../../.env"))
5+
BASE_DIR = Path(__file__).resolve().parents[2]
6+
ENV_FILE = BASE_DIR / ".env"
7+
ROOT_ENV = Path("/app/.env")
8+
9+
load_dotenv(ENV_FILE)
10+
11+
if ROOT_ENV.exists():
12+
load_dotenv(ROOT_ENV, override=True)

apps/core/src/core/crud/crud_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ async def get_public_project(
179179
project = result.scalars().first()
180180
if not project:
181181
return None
182-
project_public_read = ProjectPublicRead(**project.dict())
182+
project_public_read = ProjectPublicRead(**project.model_dump())
183183
return project_public_read
184184

185185
async def publish_project(

apps/core/src/core/schemas/layer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class IFeatureStandardUpdate(FeatureUpdateBase):
377377
class FeatureToolAttributesBase(BaseModel):
378378
"""Base model for additional attributes feature layer tool."""
379379

380-
tool_type: ToolType = Field(..., description="Tool type")
380+
tool_type: ToolType | None = Field(None, description="Tool type")
381381

382382

383383
feature_layer_tool_attributes_example = {

0 commit comments

Comments
 (0)