From ff989ceb3fac69c2a5d9cee13e8282c8641d89ff Mon Sep 17 00:00:00 2001 From: Joel Falknau Date: Wed, 5 Mar 2025 13:46:49 +1000 Subject: [PATCH] Null is allowed, it has a specific meaning --- .../migrations/0026_alter_userprofile_theme.py | 18 ------------------ allianceauth/authentication/models.py | 4 ++-- 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 allianceauth/authentication/migrations/0026_alter_userprofile_theme.py diff --git a/allianceauth/authentication/migrations/0026_alter_userprofile_theme.py b/allianceauth/authentication/migrations/0026_alter_userprofile_theme.py deleted file mode 100644 index 1e7e6933..00000000 --- a/allianceauth/authentication/migrations/0026_alter_userprofile_theme.py +++ /dev/null @@ -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'), - ), - ] diff --git a/allianceauth/authentication/models.py b/allianceauth/authentication/models.py index a8147c5c..9d235797 100644 --- a/allianceauth/authentication/models.py +++ b/allianceauth/authentication/models.py @@ -91,11 +91,11 @@ class UserProfile(models.Model): 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="") 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"), max_length=200, blank=True, - default="", + null=True, help_text="Bootstrap 5 Themes from https://bootswatch.com/ or Community Apps", )