Allow box_art to be null
This commit is contained in:
parent
bd66f3071e
commit
df6a77a1fd
2 changed files with 23 additions and 1 deletions
21
twitch/migrations/0002_alter_game_box_art.py
Normal file
21
twitch/migrations/0002_alter_game_box_art.py
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
# Generated by Django 6.0 on 2026-01-05 20:47
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
"""Alter box_art field to allow null values."""
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("twitch", "0001_initial"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="game",
|
||||||
|
name="box_art",
|
||||||
|
field=models.URLField(blank=True, default="", max_length=500, null=True, verbose_name="Box art URL"),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -77,9 +77,10 @@ class Game(models.Model):
|
||||||
default="",
|
default="",
|
||||||
verbose_name="Display name",
|
verbose_name="Display name",
|
||||||
)
|
)
|
||||||
box_art = models.URLField(
|
box_art = models.URLField( # noqa: DJ001
|
||||||
max_length=500,
|
max_length=500,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
null=True, # We allow null here to distinguish between no box art and empty string
|
||||||
default="",
|
default="",
|
||||||
verbose_name="Box art URL",
|
verbose_name="Box art URL",
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue