circular import issues and added_by migration
This commit is contained in:
parent
5a3a6151a6
commit
7381536ad6
19 changed files with 273 additions and 265 deletions
|
@ -77,12 +77,12 @@ class Book(View):
|
|||
.order_by('-updated_date')
|
||||
|
||||
user_shelves = models.ShelfBook.objects.filter(
|
||||
added_by=request.user, book=book
|
||||
user=request.user, book=book
|
||||
)
|
||||
|
||||
other_edition_shelves = models.ShelfBook.objects.filter(
|
||||
~Q(book=book),
|
||||
added_by=request.user,
|
||||
user=request.user,
|
||||
book__parent_work=book.parent_work,
|
||||
)
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ def add_book(request, list_id):
|
|||
models.ListItem.objects.create(
|
||||
book=book,
|
||||
book_list=book_list,
|
||||
added_by=request.user,
|
||||
user=request.user,
|
||||
)
|
||||
elif book_list.curation == 'curated':
|
||||
# make a pending entry
|
||||
|
@ -190,7 +190,7 @@ def add_book(request, list_id):
|
|||
approved=False,
|
||||
book=book,
|
||||
book_list=book_list,
|
||||
added_by=request.user,
|
||||
user=request.user,
|
||||
)
|
||||
else:
|
||||
# you can't add to this list, what were you THINKING
|
||||
|
@ -205,7 +205,7 @@ def remove_book(request, list_id):
|
|||
book_list = get_object_or_404(models.List, id=list_id)
|
||||
item = get_object_or_404(models.ListItem, id=request.POST.get('item'))
|
||||
|
||||
if not book_list.user == request.user and not item.added_by == request.user:
|
||||
if not book_list.user == request.user and not item.user == request.user:
|
||||
return HttpResponseNotFound()
|
||||
|
||||
item.delete()
|
||||
|
|
|
@ -44,7 +44,7 @@ def start_reading(request, book_id):
|
|||
# this just means it isn't currently on the user's shelves
|
||||
pass
|
||||
models.ShelfBook.objects.create(
|
||||
book=book, shelf=shelf, added_by=request.user)
|
||||
book=book, shelf=shelf, user=request.user)
|
||||
|
||||
# post about it (if you want)
|
||||
if request.POST.get('post-status'):
|
||||
|
@ -81,7 +81,7 @@ def finish_reading(request, book_id):
|
|||
# this just means it isn't currently on the user's shelves
|
||||
pass
|
||||
models.ShelfBook.objects.create(
|
||||
book=book, shelf=shelf, added_by=request.user)
|
||||
book=book, shelf=shelf, user=request.user)
|
||||
|
||||
# post about it (if you want)
|
||||
if request.POST.get('post-status'):
|
||||
|
|
|
@ -49,7 +49,7 @@ class Shelf(View):
|
|||
return ActivitypubResponse(shelf.to_activity(**request.GET))
|
||||
|
||||
books = models.ShelfBook.objects.filter(
|
||||
added_by=user, shelf=shelf
|
||||
user=user, shelf=shelf
|
||||
).order_by('-updated_date').all()
|
||||
|
||||
data = {
|
||||
|
@ -136,7 +136,7 @@ def shelve(request):
|
|||
# this just means it isn't currently on the user's shelves
|
||||
pass
|
||||
models.ShelfBook.objects.create(
|
||||
book=book, shelf=desired_shelf, added_by=request.user)
|
||||
book=book, shelf=desired_shelf, user=request.user)
|
||||
|
||||
# post about "want to read" shelves
|
||||
if desired_shelf.identifier == 'to-read':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue