You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched for similar issues in this repository.
Steps to reproduce the behavior
The endpoint is PATCH /api/units/<my unit id>/ and the payload is {"state": 10, "target": ["\u52a0\u8fbe\u91cc\u5de5\u4f1a\u65e5"]}. I use Python requests to send it.
When I checked the Local Vars part in the Django error output, I noticed the data variable is still a string rather than dictionary at the very bottom of the traceback.
UnitWriteSerializer(<Unit: [628506] Caldari Union Day>, context={'request': <rest_framework.request.Request: PATCH '/api/units/529344/'>, 'format': None, 'view': <weblate.api.views.UnitViewSet object>}, data='{"state": 10, "target": ["\u52a0\u8fbe\u91cc\u5de5\u4f1a\u65e5"]}', partial=True): target = PluralField() state = ChoiceField(choices=((0, 'Empty'), (10, 'Needs editing'), (20, 'Translated'), (30, 'Approved'), (100, 'Read only')), required=False, validators=[<django.core.validators.MinValueValidator object>, <django.core.validators.MaxValueValidator object>]) explanation = CharField(allow_blank=True, help_text='Additional explanation to clarify meaning or usage of the string.', required=False, style={'base_template': 'textarea.html'}) extra_flags = CharField(allow_blank=True, help_text='Additional comma-separated flags to influence Weblate behavior.', label='Translation flags', required=False, style={'base_template': 'textarea.html'}, validators=[]) labels = LabelsSerializer(many=True)
I think that should be problem.
Expected behavior
No response
Screenshots
No response
How do you run Weblate?
Docker container
Weblate versions
4.15 (docker)
Weblate deploy checks
> docker-compose exec --user weblate weblate weblate check --deploy
System check identified some issues:
INFOS:
?: (weblate.I021) Error collection is not set up, it is highly recommended for production use
HINT: https://docs.weblate.org/en/weblate-4.15/admin/install.html#collecting-errors
System check identified 1 issue (1 silenced).
Additional context
No response
The text was updated successfully, but these errors were encountered:
I noticed the data variable is still a string rather than dictionary at the very bottom of the traceback.
Yes, because you are double encoding the payload as JSON. The requests json parameter encodes it as JSON. Either do .patch(json={}) or .patch(data=json.dumps({}).
Still Weblate should not crash and report the issue correctly.
Describe the issue
version: 4.15 (docker)
When I try to update a specific unit using the API, it throws the following error:
I already tried
Steps to reproduce the behavior
The endpoint is
PATCH /api/units/<my unit id>/
and the payload is{"state": 10, "target": ["\u52a0\u8fbe\u91cc\u5de5\u4f1a\u65e5"]}
. I use Python requests to send it.The output:
When I checked the Local Vars part in the Django error output, I noticed the
data
variable is still astring
rather than dictionary at the very bottom of the traceback.I think that should be problem.
Expected behavior
No response
Screenshots
No response
How do you run Weblate?
Docker container
Weblate versions
4.15 (docker)
Weblate deploy checks
Additional context
No response
The text was updated successfully, but these errors were encountered: