Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aPUT /api/v2/workers/{worker id}
.set_team()
is called with the valueNone
in a couple places, where it looks to me to be expecting an object with anid
variable - soset_team()
tries to access the instance variable.id
within the valueNone
, which I believe would throw an error(?).This change skips the dot accessor if the argument was
None
and just assignsNone
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.