From 8eb73c2882e47ebb666375c22456f8aacfc01fee Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Mon, 4 Nov 2024 10:50:05 +0000 Subject: [PATCH 1/2] Convert hero alt test to NOT NULL Add a default empty string for existing values --- .../0013_alter_post_hero_alt_text.py | 23 +++++++++++++++++++ democracy_club/apps/hermes/models.py | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 democracy_club/apps/hermes/migrations/0013_alter_post_hero_alt_text.py diff --git a/democracy_club/apps/hermes/migrations/0013_alter_post_hero_alt_text.py b/democracy_club/apps/hermes/migrations/0013_alter_post_hero_alt_text.py new file mode 100644 index 00000000..e8029225 --- /dev/null +++ b/democracy_club/apps/hermes/migrations/0013_alter_post_hero_alt_text.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.16 on 2024-11-04 10:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("hermes", "0012_post_hero_alt_text"), + ] + + operations = [ + migrations.AlterField( + model_name="post", + name="hero_alt_text", + field=models.CharField( + blank=True, + default="", + max_length=100, + verbose_name="hero alt text", + ), + preserve_default=False, + ), + ] diff --git a/democracy_club/apps/hermes/models.py b/democracy_club/apps/hermes/models.py index eb5855dd..1879b691 100644 --- a/democracy_club/apps/hermes/models.py +++ b/democracy_club/apps/hermes/models.py @@ -181,7 +181,7 @@ class Post(TimestampedModel): _("hero"), upload_to=post_hero_upload_to, blank=True, null=True ) hero_alt_text = models.CharField( - _("hero alt text"), max_length=100, blank=True, null=True + _("hero alt text"), max_length=100, blank=True ) subject = models.CharField(_("subject"), max_length=100) slug = models.SlugField(_("slug"), max_length=100, unique=True) From f34a047e3760c5ca7794e9b8ece22f6aba9b5c3c Mon Sep 17 00:00:00 2001 From: Sym Roe Date: Mon, 4 Nov 2024 10:53:18 +0000 Subject: [PATCH 2/2] Update ruff configuration Drive by to fix a warning --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c74a04b3..34c22551 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,8 @@ [tool.ruff] line-length = 80 +extend-exclude = ["democracy_club/settings/local.py"] + +[tool.ruff.lint] ignore = ["E501"] extend-select = [ "I", @@ -8,7 +11,6 @@ extend-select = [ "Q003", "RET", ] -extend-exclude = ["democracy_club/settings/local.py"] [tool.coverage.report] exclude_lines = [