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

fix: Unset worker team_id #481

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bosconian-dynamics
Copy link

@bosconian-dynamics bosconian-dynamics commented Jan 29, 2025

Fixes #480

From a brief scan, this is my best guess at the source of the HTTP 500 when sending a payload containing "team": "" in a PUT /api/v2/workers/{worker id}. set_team() is called with the value None in a couple places, where it looks to me to be expecting an object with an id variable - so set_team() tries to access the instance variable .id within the value None, which I believe would throw an error(?).

This change skips the dot accessor if the argument was None and just assigns None directly to the field instead.

Careful review requested! 🙏 I don't speak snek and I'm not familiar with SQLAlchemy. I also have yet to set up a development environment for AI Horde so I have not tested this change - but I'll get on the dev env over the weekend, if not before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

500 on PUT /v2/workers/{worker_id} with team set to empty string
1 participant