Merge pull request #12382 from kkthxbye-code/12380-widget-fix-missing-ct

Fixes #12380 - Add ObjectChange as a valid option for ObjectListWidget and ObjectCountsWidget
This commit is contained in:
Jeremy Stretch 2023-05-01 10:17:11 -04:00 committed by GitHub
commit a0f0b29432
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ from django import forms
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.cache import cache
from django.db.models import Q
from django.template.loader import render_to_string
from django.urls import NoReverseMatch, reverse
from django.utils.translation import gettext as _
@ -33,7 +34,7 @@ def get_content_type_labels():
return [
(content_type_identifier(ct), content_type_name(ct))
for ct in ContentType.objects.filter(
FeatureQuery('export_templates').get_query()
FeatureQuery('export_templates').get_query() | Q(app_label='extras', model='objectchange')
).order_by('app_label', 'model')
]