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
{{ message }}
Repository navigation
LanguageSerializer silently drops plural edits on PATCH/PUT #22077
LanguageSerializer (weblate/api/serializers.py) defines a writable nested plural field, validated via LanguagePluralSerializer, but only overrides create() — there's no update() override. Language.plural is a @cached_property with no DB-backed setter, so DRF's default ModelSerializer.update() just assigns the dict into instance.__dict__["plural"] (shadowing the cached property) and calls instance.save(), which has no column to persist it to.
I've searched for similar filed issues in this repository.
Steps to reproduce the behavior
PATCH /api/languages/<code>/ with a body containing updated plural data (e.g. a different formula or number).
Response is 200 OK.
Check the corresponding Plural row in the database — it is unchanged.
Expected behavior
Either the Plural row should be updated to match the submitted data, or the API should reject the write (e.g. make the field read-only on update) instead of silently accepting and discarding it.
"N/A — this was found via code review of the main branch, not reproduced against a running deployment."
Additional context
Found while reviewing the API serializers for an unrelated contribution; happy to submit a PR adding the missing update() handling if that's the preferred fix.
@nicommteam are you still planning to send the PR you offered here? If you are, I'll leave it to you.
Otherwise I have a fix ready that takes the first option from the issue: LanguageSerializer.update() writes the submitted values to the language's Plural row, a partial plural is validated against the stored number and formula, and changing the plural's source is rejected. It comes with API tests for PATCH. If I don't hear back, I'll open it tomorrow, unless a maintainer would rather make plural read-only on update.
This was really supposed to be only a create path. For the update, it might be ambiguous (the default plural might change between read and update, so the outcome might be other than desired). So I think the right approach would be to adjust OpenAPI schema, documentation and reject embedded plural on updates.
This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.
Activity
Rahul-cs50 commentedon Oct 21, 2026
@nicommteam are you still planning to send the PR you offered here? If you are, I'll leave it to you.
Otherwise I have a fix ready that takes the first option from the issue:
LanguageSerializer.update()writes the submitted values to the language'sPluralrow, a partialpluralis validated against the stored number and formula, and changing the plural'ssourceis rejected. It comes with API tests for PATCH. If I don't hear back, I'll open it tomorrow, unless a maintainer would rather makepluralread-only on update.nijel commentedon Oct 22, 2026
This was really supposed to be only a create path. For the update, it might be ambiguous (the default plural might change between read and update, so the outcome might be other than desired). So I think the right approach would be to adjust OpenAPI schema, documentation and reject embedded plural on updates.
github-actions commentedon Oct 22, 2026
This issue seems to be a good fit for newbie contributors. You are welcome to contribute to Weblate! Don't hesitate to ask any questions you would have while implementing this.
You can learn about how to get started in our contributors documentation.
fix(api): reject plural on language updates
github-actions commentedon Oct 23, 2026
Thank you for your report — the issue has now been resolved.
The fix has been merged into the repository and will be included in the upcoming Weblate 2026.11 release.