hotosm / fmtm

Field Mapping Tasking Manager - coordinated field mapping.
https://fmtm.hotosm.org/
GNU Affero General Public License v3.0
42 stars 44 forks source link

unable to update task status #1657

Closed manjitapandey closed 1 month ago

manjitapandey commented 1 month ago

Describe the bug I am unable to update the task status to locked for mapping. This issue can be replicated on dev server. The console panel shows 500 error on https://api.dev.fmtm.hotosm.org/tasks/10889/new-status/1?project_id=40 post API

To Reproduce Steps to reproduce the behavior:

  1. Go to 'any project'
  2. Click on 'a task you want to mark as locked for mapping'
  3. See error

Expected behavior The task should be locked for mapping.

Screenshots image

Additional context Add any other context about the problem here.

spwoodcock commented 1 month ago

Oh I had that issue when working on the mapper frontend - I thought it was due to my db schema changes.

I guess not!

It was a simple fix if I remember - I think it was the indexing of the returned db object

Sujanadh commented 1 month ago

working on it

spwoodcock commented 1 month ago

I just rebased the mapper frontend branch to latest development - seems the issue isn't what I thought it was.

It's just the change to the return type of the mapper role:

image

A db object is returned instead of a pydantic model now. This is probably for the best, for consistency with other role types.

But it does mean we need to check all the endpoints that have AuthUser = Depends(mapper) 😬 There are 21 by the looks of it.

spwoodcock commented 1 month ago

This is a bigger issue, as described above. Multiple endpoints don't work as a result, including project creation.

Need... tests... arrrgghhhh giphy