🔨(backend) make the 'language' attribute on the User model nullable

- allow the language on the user to be unset
- set the default language to be unset
- helps us determine that the user has yet to set a language preference
This commit is contained in:
rvveber
2025-02-25 15:08:59 +01:00
committed by Samuel Paccoud
parent b24acd14e2
commit 9a79b09b07
2 changed files with 39 additions and 1 deletions

View File

@@ -194,9 +194,11 @@ class User(AbstractBaseUser, BaseModel, auth_models.PermissionsMixin):
language = models.CharField(
max_length=10,
choices=lazy(lambda: settings.LANGUAGES, tuple)(),
default=settings.LANGUAGE_CODE,
default=None,
verbose_name=_("language"),
help_text=_("The language in which the user wants to see the interface."),
null=True,
blank=True,
)
timezone = TimeZoneField(
choices_display="WITH_GMT_OFFSET",