diff --git a/course_discovery/apps/course_metadata/admin.py b/course_discovery/apps/course_metadata/admin.py index 0917a96cea..8f5900d0d0 100644 --- a/course_discovery/apps/course_metadata/admin.py +++ b/course_discovery/apps/course_metadata/admin.py @@ -524,7 +524,8 @@ class CorporateEndorsementAdmin(admin.ModelAdmin): @admin.register(FAQ) class FAQAdmin(admin.ModelAdmin): - list_display = ('question',) + list_display = ('id', 'question', 'answer') + search_fields = ('id', 'question',) @admin.register(Ranking) diff --git a/course_discovery/apps/course_metadata/models.py b/course_discovery/apps/course_metadata/models.py index 655c8a0974..59283c7605 100644 --- a/course_discovery/apps/course_metadata/models.py +++ b/course_discovery/apps/course_metadata/models.py @@ -3192,7 +3192,7 @@ class Meta: ordering = ['created'] def __str__(self): - return self.question + return f'{self.pk}: {self.question}' class Program(ManageHistoryMixin, PkSearchableMixin, TimeStampedModel): diff --git a/course_discovery/apps/course_metadata/tests/test_models.py b/course_discovery/apps/course_metadata/tests/test_models.py index 14208a2542..53de73d2a6 100644 --- a/course_discovery/apps/course_metadata/tests/test_models.py +++ b/course_discovery/apps/course_metadata/tests/test_models.py @@ -3802,7 +3802,7 @@ class FAQTests(TestCase): def test_str(self): question = 'test question' faq = FAQ.objects.create(question=question, answer='test') - assert str(faq) == question + assert str(faq) == f'{faq.id}: {faq.question}' class RankingTests(TestCase):