fix: allow content libraries to be created through Django admin (#31719)

Previously, CMS Django admin would demand that at least one
LTIConfig be associated with the new library. This is not
necessary, but Django thought it was, because the `blank`
flag was not enabled on the ContentLibrary model's
`authored_lti_config` many-to-many field.

This should not affect the experimental blockstore-based
library authoring frontend, which already allows libraries
to be created without any authorized_lti_configs.

This will not affect the existing modulestore-based
library authoring frontend, since it doesn't even use
any of the models in question.

A migration is included with this commit, but it should NOT
change MySQL schema, since `blank` is a Django-level validation
flag.
This commit is contained in:
Kyle McCormick
2023-02-07 08:17:01 -05:00
committed by GitHub
parent e6e64b1fa9
commit b5fd4cc55f
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
# Generated by Django 3.2.16 on 2023-02-06 21:39
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lti1p3_tool_config', '0001_initial'),
('content_libraries', '0008_auto_20210818_2148'),
]
operations = [
migrations.AlterField(
model_name='contentlibrary',
name='authorized_lti_configs',
field=models.ManyToManyField(blank=True, help_text="List of authorized LTI tool configurations that can access this library's content through LTI launches, if empty no LTI launch is allowed.", related_name='content_libraries', to='lti1p3_tool_config.LtiTool'),
),
]

View File

@@ -126,7 +126,8 @@ class ContentLibrary(models.Model):
related_name='content_libraries',
help_text=("List of authorized LTI tool configurations that can access "
"this library's content through LTI launches, if empty no LTI "
"launch is allowed.")
"launch is allowed."),
blank=True,
)
class Meta: