Null is allowed, it has a specific meaning

This commit is contained in:
Joel Falknau 2025-03-05 13:46:49 +10:00
parent 564ad19e13
commit ff989ceb3f
No known key found for this signature in database
2 changed files with 2 additions and 20 deletions

View File

@ -1,18 +0,0 @@
# Generated by Django 5.1.6 on 2025-03-05 00:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0025_v5squash'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
name='theme',
field=models.CharField(blank=True, default='', help_text='Bootstrap 5 Themes from https://bootswatch.com/ or Community Apps', max_length=200, verbose_name='Theme'),
),
]

View File

@ -91,11 +91,11 @@ class UserProfile(models.Model):
state = models.ForeignKey(State, on_delete=models.SET_DEFAULT, default=get_guest_state_pk) state = models.ForeignKey(State, on_delete=models.SET_DEFAULT, default=get_guest_state_pk)
language = models.CharField(_("Language"), max_length=10, choices=Language.choices, blank=True, default="") language = models.CharField(_("Language"), max_length=10, choices=Language.choices, blank=True, default="")
night_mode = models.BooleanField(_("Night Mode"), blank=True, null=True) night_mode = models.BooleanField(_("Night Mode"), blank=True, null=True)
theme = models.CharField( theme = models.CharField( # noqa:DJ001 Null has a specific meaning, never set by user
_("Theme"), _("Theme"),
max_length=200, max_length=200,
blank=True, blank=True,
default="", null=True,
help_text="Bootstrap 5 Themes from https://bootswatch.com/ or Community Apps", help_text="Bootstrap 5 Themes from https://bootswatch.com/ or Community Apps",
) )