Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/hotosm/fmtm into dev…
Browse files Browse the repository at this point in the history
…elopment
  • Loading branch information
varun2948 committed Aug 25, 2023
2 parents 22e67b4 + 4fa5273 commit 0d18e6a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/backend/app/central/central_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from osm_fieldwork.OdkCentral import OdkAppUser, OdkForm, OdkProject
from pyxform.xls2xform import xls2xform_convert
from sqlalchemy.orm import Session
from fastapi.responses import JSONResponse

from ..config import settings
from ..db import db_models
Expand Down Expand Up @@ -365,10 +366,7 @@ async def test_form_validity(xform_content: str, form_type: str):
xls2xform_convert(xlsform_path=xlsform_path, xform_path=outfile, validate=False)
return {"message": "Your form is valid"}
except Exception as e:
raise HTTPException(
status_code=400,
detail={"message": "Your form is invalid", "possible_reason": str(e)},
)
return JSONResponse(content={"message":"Your form is invalid", "possible_reason":str(e)}, status_code=400)


def generate_updated_xform(
Expand Down
1 change: 1 addition & 0 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,7 @@ def convert_to_project_summary(db_project: db_models.DbProject):
summary.num_contributors = (
db_project.tasks_mapped + db_project.tasks_validated
) # TODO: get real number of contributors
summary.organisation_logo = db_project.organisation.logo if db_project.organisation else None

return summary
else:
Expand Down
1 change: 1 addition & 0 deletions src/backend/app/projects/project_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ProjectSummary(BaseModel):
tasks_bad: int = None
hashtags: List[str] = None
organisation_id: int = None
organisation_logo: str = None

class Config:
orm_mode = True
Expand Down

0 comments on commit 0d18e6a

Please sign in to comment.