mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-29 17:36:49 +01:00
Skip extract_references on ChooserBlock if model is not a real model
This commit is contained in:
parent
2dcfdedc37
commit
98784fa153
@ -2,6 +2,7 @@ import datetime
|
||||
from decimal import Decimal
|
||||
|
||||
from django import forms
|
||||
from django.db.models import Model
|
||||
from django.db.models.fields import BLANK_CHOICE_DASH
|
||||
from django.forms.fields import CallableChoiceIterator
|
||||
from django.utils.dateparse import parse_date, parse_datetime, parse_time
|
||||
@ -831,7 +832,7 @@ class ChooserBlock(FieldBlock):
|
||||
return super().clean(value)
|
||||
|
||||
def extract_references(self, value):
|
||||
if value is not None:
|
||||
if value is not None and issubclass(self.model_class, Model):
|
||||
yield self.model_class, str(value.pk), "", ""
|
||||
|
||||
class Meta:
|
||||
|
Loading…
Reference in New Issue
Block a user