mirror of
https://github.com/Fluffy-Bean/Fluffys-website.git
synced 2024-12-28 02:06:05 +00:00
1360792163
Format code with black
This commit fixes the style issues introduced in 9f79143
according to the output
from Black.
Details: None
20 lines
572 B
Python
20 lines
572 B
Python
from django.shortcuts import render, get_object_or_404
|
|
from django.http import HttpResponse
|
|
from articles.models import Article
|
|
|
|
|
|
def article_list(request):
|
|
articles = (
|
|
Article.objects.defer("body").filter(published=True).order_by("-date").all()
|
|
)
|
|
return render(request, "views/articles.html", {"articles": articles})
|
|
|
|
|
|
def article_detail(request, slug):
|
|
article = get_object_or_404(Article, slug=slug)
|
|
|
|
if not article.published:
|
|
return HttpResponse("Not found")
|
|
|
|
return render(request, "views/article.html", {"article": article})
|