Don't store default edition in the dataase
This commit is contained in:
parent
ccf10e8012
commit
6551c59c45
14 changed files with 56 additions and 62 deletions
|
@ -27,7 +27,7 @@ class Author(View):
|
|||
).distinct()
|
||||
data = {
|
||||
"author": author,
|
||||
"books": [b.get_default_edition() for b in books],
|
||||
"books": [b.default_edition for b in books],
|
||||
}
|
||||
return TemplateResponse(request, "author.html", data)
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class Book(View):
|
|||
return ActivitypubResponse(book.to_activity())
|
||||
|
||||
if isinstance(book, models.Work):
|
||||
book = book.get_default_edition()
|
||||
book = book.default_edition
|
||||
if not book or not book.parent_work:
|
||||
return HttpResponseNotFound()
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ def get_edition(book_id):
|
|||
"""look up a book in the db and return an edition"""
|
||||
book = models.Book.objects.select_subclasses().get(id=book_id)
|
||||
if isinstance(book, models.Work):
|
||||
book = book.get_default_edition()
|
||||
book = book.default_edition
|
||||
return book
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue