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:
@@ -1,5 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.core.management.base import BaseCommand
|
||||
from taggit.models import Tag
|
||||
@@ -200,8 +202,8 @@ class Command(BaseCommand):
|
||||
]
|
||||
)
|
||||
|
||||
# Admin user for E2E admin tests
|
||||
if not User.objects.filter(username="e2e-admin").exists():
|
||||
# Admin user for E2E admin tests — only when E2E_MODE is set
|
||||
if os.environ.get("E2E_MODE") and not User.objects.filter(username="e2e-admin").exists():
|
||||
User.objects.create_superuser(
|
||||
username="e2e-admin",
|
||||
email="e2e-admin@example.com",
|
||||
|
||||
Reference in New Issue
Block a user