Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to update task status #1657

Closed
manjitapandey opened this issue Jul 16, 2024 · 4 comments
Closed

unable to update task status #1657

manjitapandey opened this issue Jul 16, 2024 · 4 comments
Assignees
Labels
backend Related to backend code bug Something isn't working effort:low Likely a few hours priority:critical Blocking current tasks or user workflow testing:ready Ready for testing

Comments

@manjitapandey
Copy link
Collaborator

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.

@manjitapandey manjitapandey added bug Something isn't working backend Related to backend code labels Jul 16, 2024
@spwoodcock
Copy link
Member

spwoodcock commented Jul 16, 2024

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
Copy link
Collaborator

working on it

@Sujanadh Sujanadh self-assigned this Jul 16, 2024
@spwoodcock
Copy link
Member

spwoodcock commented Jul 16, 2024

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.

  • The type should be ProjectUserDict = Depends(mapper)
  • The roles.get_uid method can probably be removed
  • We could refactor endpoints with mapper permission that get the DbProject using the id. Now we return the DbProject directly and that could be passed through to functions that need it.

@spwoodcock
Copy link
Member

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

Need... tests... arrrgghhhh
giphy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code bug Something isn't working effort:low Likely a few hours priority:critical Blocking current tasks or user workflow testing:ready Ready for testing
Projects
Development

No branches or pull requests

3 participants