Refactor dashboard_view to exclude TESTING campaigns from active campaigns list
All checks were successful
Deploy to Server / deploy (push) Successful in 22s
All checks were successful
Deploy to Server / deploy (push) Successful in 22s
This commit is contained in:
parent
4b04659fce
commit
204f12bb9d
1 changed files with 4 additions and 3 deletions
|
|
@ -29,9 +29,10 @@ def dashboard_view(request: HttpRequest) -> HttpResponse:
|
|||
HttpResponse: The HTTP response containing the rendered dashboard page.
|
||||
"""
|
||||
active_campaigns: QuerySet[models.ChzzkCampaign, models.ChzzkCampaign] = (
|
||||
models.ChzzkCampaign.objects.filter(end_date__gte=timezone.now()).order_by(
|
||||
"-start_date",
|
||||
)
|
||||
models.ChzzkCampaign.objects
|
||||
.filter(end_date__gte=timezone.now())
|
||||
.exclude(status="TESTING")
|
||||
.order_by("-start_date")
|
||||
)
|
||||
return render(
|
||||
request=request,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue