Adds edit author form and stores last edited by
This commit is contained in:
@ -244,7 +244,7 @@ def edit_book(request, book_id):
|
||||
return TemplateResponse(request, 'edit_book.html', data)
|
||||
book = form.save()
|
||||
|
||||
outgoing.handle_update_book(request.user, book)
|
||||
outgoing.handle_update_book_data(request.user, book)
|
||||
return redirect('/book/%s' % book.id)
|
||||
|
||||
|
||||
@ -291,7 +291,7 @@ def upload_cover(request, book_id):
|
||||
book.cover = form.files['cover']
|
||||
book.save()
|
||||
|
||||
outgoing.handle_update_book(request.user, book)
|
||||
outgoing.handle_update_book_data(request.user, book)
|
||||
return redirect('/book/%s' % book.id)
|
||||
|
||||
|
||||
@ -310,10 +310,31 @@ def add_description(request, book_id):
|
||||
book.description = description
|
||||
book.save()
|
||||
|
||||
outgoing.handle_update_book(request.user, book)
|
||||
outgoing.handle_update_book_data(request.user, book)
|
||||
return redirect('/book/%s' % book.id)
|
||||
|
||||
|
||||
@login_required
|
||||
@permission_required('bookwyrm.edit_book', raise_exception=True)
|
||||
@require_POST
|
||||
def edit_author(request, author_id):
|
||||
''' edit a author cool '''
|
||||
author = get_object_or_404(models.Author, id=author_id)
|
||||
|
||||
form = forms.AuthorForm(request.POST, request.FILES, instance=author)
|
||||
if not form.is_valid():
|
||||
data = {
|
||||
'title': 'Edit Author',
|
||||
'author': author,
|
||||
'form': form
|
||||
}
|
||||
return TemplateResponse(request, 'edit_author.html', data)
|
||||
author = form.save()
|
||||
|
||||
outgoing.handle_update_book_data(request.user, author)
|
||||
return redirect('/author/%s' % author.id)
|
||||
|
||||
|
||||
@login_required
|
||||
@require_POST
|
||||
def create_shelf(request):
|
||||
|
Reference in New Issue
Block a user