Make old_type optional
This commit is contained in:
parent
c58e33b1e9
commit
6539ac88d8
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.24 on 2021-11-29 10:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('basicknowledge', '0013_auto_20211110_1140'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='basicknowledge',
|
||||
name='old_type',
|
||||
field=models.CharField(blank=True, choices=[('language_communication', 'Sprache & Kommunikation'), ('society', 'Gesellschaft'), ('interdisciplinary', 'Überfachliches Instrument')], max_length=100),
|
||||
),
|
||||
]
|
||||
|
|
@ -57,7 +57,8 @@ class BasicKnowledge(StrictHierarchyPage):
|
|||
|
||||
old_type = models.CharField(
|
||||
max_length=100,
|
||||
choices=InstrumentType.CATEGORY_CHOICES
|
||||
choices=InstrumentType.CATEGORY_CHOICES,
|
||||
blank=True
|
||||
)
|
||||
|
||||
content_panels = [
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ def get_room_blocks(page):
|
|||
|
||||
|
||||
def get_block_from_stream_data(stream_data, block_name):
|
||||
if len(stream_data) == 0:
|
||||
return []
|
||||
|
||||
if isinstance(stream_data[0], tuple):
|
||||
return [block for block in stream_data if block[0] in [block_name]]
|
||||
if isinstance(stream_data[0], dict):
|
||||
|
|
|
|||
Loading…
Reference in New Issue