Skip to content

Commit

Permalink
chore: Update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
last-partizan committed Feb 8, 2025
1 parent 85fc2cb commit fb96e78
Show file tree
Hide file tree
Showing 6 changed files with 264 additions and 179 deletions.
3 changes: 1 addition & 2 deletions modeltranslation/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,7 @@ def _group_fieldsets(self, fieldsets: list) -> list:
untranslated_fields = [
f.name
for f in fields
if
(
if (
# Exclude the primary key field
f is not self.opts.auto_field
# Exclude non-editable fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def add_arguments(self, parser: CommandParser) -> None:
"--language",
action="store",
help=(
"Language translation field the be updated."
" Default language field if not provided"
"Language translation field the be updated. Default language field if not provided"
),
)

Expand Down
24 changes: 12 additions & 12 deletions modeltranslation/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@ def test_verbose_name(self):

def test_descriptor_introspection(self):
# See Django #8248
assert isinstance(
models.TestModel.title.__doc__, str
), "Descriptor accessed on class should return itself."
assert isinstance(models.TestModel.title.__doc__, str), (
"Descriptor accessed on class should return itself."
)

def test_fields_hashes(self):
opts = models.TestModel._meta
Expand Down Expand Up @@ -3300,19 +3300,19 @@ def test_managers_failure(self):

from .models import InheritedPermission

assert not isinstance(
Permission.objects, MultilingualManager
), "Permission is using MultilingualManager"
assert isinstance(
InheritedPermission.objects, MultilingualManager
), "InheritedPermission is not using MultilingualManager"
assert not isinstance(Permission.objects, MultilingualManager), (
"Permission is using MultilingualManager"
)
assert isinstance(InheritedPermission.objects, MultilingualManager), (
"InheritedPermission is not using MultilingualManager"
)

# This happens at initialization time, depending on the models
# initialized.
Permission._meta._expire_cache()

assert not isinstance(
Permission.objects, MultilingualManager
), "Permission is using MultilingualManager"
assert not isinstance(Permission.objects, MultilingualManager), (
"Permission is using MultilingualManager"
)
user = User.objects.create(username="123", is_active=True)
user.has_perm("test_perm")
4 changes: 1 addition & 3 deletions modeltranslation/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,7 @@ def get_options_for_model(self, model: type[Model]) -> TranslationOptions:
"""
opts = self._get_options_for_model(model)
if not opts.registered and not opts.related:
raise NotRegistered(
'The model "%s" is not registered for ' "translation" % model.__name__
)
raise NotRegistered('The model "%s" is not registered for translation' % model.__name__)
return opts

def execute_lazy_operations(self) -> None:
Expand Down
Loading

0 comments on commit fb96e78

Please sign in to comment.