Make content_category non-nullable

This commit is contained in:
Ciarán Ainsworth 2022-07-19 15:32:09 +02:00
parent d90e850265
commit a2cb4cbdc8
3 changed files with 19 additions and 2 deletions

View File

@ -132,7 +132,6 @@ SPECTACULAR_SETTINGS = {
"OAUTH2_AUTHORIZATION_URL": "/authorize",
"OAUTH2_TOKEN_URL": "/api/v1/oauth/token/",
"PREPROCESSING_HOOKS": ["config.schema.custom_preprocessing_hook"],
'ENUM_ADD_EXPLICIT_BLANK_NULL_CHOICE': False,
"ENUM_NAME_OVERRIDES": {
"FederationChoiceEnum": "funkwhale_api.federation.models.TYPE_CHOICES",
"ReportTypeEnum": "funkwhale_api.moderation.models.REPORT_TYPES",

View File

@ -0,0 +1,18 @@
# Generated by Django 3.2.14 on 2022-07-19 13:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('music', '0055_auto_20220627_1915'),
]
operations = [
migrations.AlterField(
model_name='artist',
name='content_category',
field=models.CharField(choices=[('music', 'music'), ('podcast', 'podcast'), ('other', 'other')], db_index=True, default='music', max_length=30),
),
]

View File

@ -251,7 +251,7 @@ class Artist(APIModelMixin):
db_index=True,
default="music",
choices=ARTIST_CONTENT_CATEGORY_CHOICES,
null=True,
null=False,
)
modification_date = models.DateTimeField(default=timezone.now, db_index=True)
api = musicbrainz.api.artists