Refactors get_or_create_book
This commit is contained in:
parent
2a98093ebe
commit
2ef87c2131
9 changed files with 258 additions and 280 deletions
|
@ -115,6 +115,13 @@ def edit_profile(request):
|
|||
return redirect('/user/%s' % request.user.localname)
|
||||
|
||||
|
||||
def resolve_book(request):
|
||||
''' figure out the local path to a book from a remote_id '''
|
||||
remote_id = request.POST.get('remote_id')
|
||||
book = get_or_create_book(remote_id, key='remote_id')
|
||||
return redirect('/book/%d' % book.id)
|
||||
|
||||
|
||||
@login_required
|
||||
def edit_book(request, book_id):
|
||||
''' edit a book cool '''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue