Address PR review feedback
- Gate e2e-admin superuser behind E2E_MODE env var (security) - Add status and tag filters to ArticleFilterSet - Set default_ordering to -published_date on listing viewset - Add summary to ArticlePage.search_fields for search support - Add 4 new tests for filters, ordering, and search fields Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,7 @@ from wagtail.admin.panels import FieldPanel, ObjectList, PageChooserPanel, Tabbe
|
||||
from wagtail.contrib.routable_page.models import RoutablePageMixin, route
|
||||
from wagtail.fields import RichTextField, StreamField
|
||||
from wagtail.models import Page
|
||||
from wagtail.search import index
|
||||
from wagtailseo.models import SeoMixin
|
||||
|
||||
from apps.blog.blocks import ARTICLE_BODY_BLOCKS
|
||||
@@ -232,7 +233,9 @@ class ArticlePage(SeoMixin, Page):
|
||||
]
|
||||
)
|
||||
|
||||
search_fields = Page.search_fields
|
||||
search_fields = Page.search_fields + [
|
||||
index.SearchField("summary"),
|
||||
]
|
||||
|
||||
def save(self, *args: Any, **kwargs: Any) -> None:
|
||||
if not self.category_id:
|
||||
|
||||
Reference in New Issue
Block a user