simplify urls and customflatpages
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
from django.urls import path
|
||||
|
||||
from . import apps
|
||||
from . import views
|
||||
|
||||
app_name = apps.BlackboardConfig.name
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="blackboard"),
|
||||
path("", views.index, name="index"),
|
||||
]
|
||||
|
||||
@@ -3,7 +3,6 @@ from datetime import timedelta
|
||||
from django.shortcuts import render
|
||||
from django.utils import timezone
|
||||
|
||||
from core.models import CustomFlatPage
|
||||
from .models import JobPosting
|
||||
|
||||
|
||||
@@ -12,13 +11,9 @@ def index(request):
|
||||
job_postings = JobPosting.all_job_postings.filter(
|
||||
publish_date__gt=job_postings_cutoff
|
||||
)
|
||||
bb_info = CustomFlatPage.objects.filter(title__iexact="blackboard").first()
|
||||
bb_empty = CustomFlatPage.objects.filter(title__iexact="blackboard empty").first()
|
||||
|
||||
context = {
|
||||
"job_postings": job_postings.order_by("-publish_date"),
|
||||
"bb_info": bb_info,
|
||||
"bb_empty": bb_empty,
|
||||
}
|
||||
|
||||
return render(request, "blackboard/index.html", context)
|
||||
|
||||
Reference in New Issue
Block a user