Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ jobs:
strategy:
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
django: ["5.1", "5.2"]
django: ["5.1", "5.2", "6.0"]
database: ["sqlite", "postgres", "mysql"]
exclude:
- python: "3.14"
django: "5.1"
- python: "3.10"
django: "6.0"
- python: "3.11"
django: "6.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DJANGO: ${{ matrix.django }}
Expand Down
11 changes: 9 additions & 2 deletions modeltranslation/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from django.db.models.utils import create_namedtuple_class
from django.utils.tree import Node

from modeltranslation._compat import _django_version
from modeltranslation._typing import Self, AutoPopulate
from modeltranslation.fields import TranslationField
from modeltranslation.thread_context import auto_populate_mode
Expand Down Expand Up @@ -375,7 +376,9 @@ def update(self, **kwargs: Any) -> int:

update.alters_data = True

def _update(self, values: list[tuple[Field, type[Model] | None, Any]]) -> CursorWrapper:
def _update(
self, values: list[tuple[Field, type[Model] | None, Any]], returning_fields=None
) -> CursorWrapper:
"""
This method is called in .save() method to update an existing record.
Here we force to update translation fields as well if the original
Expand All @@ -394,7 +397,11 @@ def _update(self, values: list[tuple[Field, type[Model] | None, Any]]) -> Cursor
translation_values.append((translatable_field, model, value))

values += translation_values
return super()._update(values)

if _django_version < (6, 0):
return super()._update(values)

return super()._update(values, returning_fields)

# This method was not present in django-linguo
@property
Expand Down