Skip to content

Commit 5fa6784

Browse files
committed
♻️(backend) remove lazy from languages field on User model
The idea behind wrapping choices in `lazy` function was to allow overriding the list of languages in tests with `override_settings`. This was causin makemigrations to keep on including the field in migrations when it is not needed. Since we finally don't override the LANGUAGES setting in tests, we can remove it to fix the problem.
1 parent d1dcd94 commit 5fa6784

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/core/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from django.db.models.functions import Left, Length
2525
from django.template.loader import render_to_string
2626
from django.utils import timezone
27-
from django.utils.functional import cached_property, lazy
27+
from django.utils.functional import cached_property
2828
from django.utils.translation import get_language, override
2929
from django.utils.translation import gettext_lazy as _
3030

@@ -244,7 +244,7 @@ class User(AbstractBaseUser, BaseModel, auth_models.PermissionsMixin):
244244

245245
language = models.CharField(
246246
max_length=10,
247-
choices=lazy(lambda: settings.LANGUAGES, tuple)(),
247+
choices=settings.LANGUAGES,
248248
default=None,
249249
verbose_name=_("language"),
250250
help_text=_("The language in which the user wants to see the interface."),

0 commit comments

Comments
 (0)