Skip to content

Commit

Permalink
Merge branch 'development' of github.com:hotosm/fmtm into development
Browse files Browse the repository at this point in the history
  • Loading branch information
varun2948 committed Jul 24, 2023
2 parents 82d5a2f + 6d63f84 commit 75d95c9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def assemble_db_connection(cls, v: str, values: dict[str, Any]) -> Any:
OSM_SECRET_KEY: str
OAUTHLIB_INSECURE_TRANSPORT: Optional[str] = 1

SENTRY_DSN: Optional[str]

class Config:
"""Pydantic settings config."""

Expand Down
9 changes: 8 additions & 1 deletion src/backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import sys
from typing import Union

import sentry_sdk
from fastapi import FastAPI, Request
from fastapi.exceptions import RequestValidationError
from fastapi.middleware.cors import CORSMiddleware
Expand All @@ -34,12 +35,12 @@
from .central import central_routes
from .config import settings
from .db.database import Base, engine, get_db
from .organization import organization_routes
from .projects import project_routes
from .projects.project_crud import read_xlsforms
from .submission import submission_routes
from .tasks import tasks_routes
from .users import user_routes
from .organization import organization_routes

# Env variables
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = settings.OAUTHLIB_INSECURE_TRANSPORT
Expand All @@ -58,6 +59,12 @@
logger = logging.getLogger(__name__)


sentry_sdk.init(
dsn=settings.SENTRY_DSN,
traces_sample_rate=0.1,
)


def get_application() -> FastAPI:
"""Get the FastAPI app instance, with settings."""
_app = FastAPI(
Expand Down
18 changes: 17 additions & 1 deletion src/backend/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies = [
"bcrypt==4.0.1",
"segno==1.5.2",
"osm-fieldwork==0.3.2",
"sentry-sdk==1.9.6"
]
requires-python = ">=3.10"
readme = "../../README.md"
Expand Down

0 comments on commit 75d95c9

Please sign in to comment.