detab source file

pull/1/head
eric 2011-12-31 13:49:23 -05:00
parent 9d6066c929
commit 1cad25da28
1 changed files with 29 additions and 29 deletions

View File

@ -682,9 +682,9 @@ def wishlist(request):
# TODO: where to redirect?
return HttpResponseRedirect('/')
elif add_work_id:
# if adding from work page, we have may work.id, not googlebooks_id
work = models.Work.objects.get(pk=add_work_id)
request.user.wishlist.add_work(work,'user')
# if adding from work page, we have may work.id, not googlebooks_id
work = models.Work.objects.get(pk=add_work_id)
request.user.wishlist.add_work(work,'user')
return HttpResponseRedirect('/')
class CampaignFormView(FormView):
@ -906,7 +906,7 @@ def librarything_load(request):
ct.user = user
ct.description = "Loading LibraryThing collection of %s to user %s." % (lt_username, user)
ct.save()
return HttpResponse("<span style='margin: auto 10px auto 36px;vertical-align: middle;display: inline-block;'>We're on it! <a href='JavaScript:window.location.reload()'>Reload the page</a> to see the books we've snagged so far.</span>")
except Exception,e:
return HttpResponse("Error in loading LibraryThing library: %s " % (e))
@ -1020,29 +1020,29 @@ def work_goodreads(request, work_id):
return HttpResponseRedirect(url)
def emailshare(request):
if request.method == 'POST':
form=EmailShareForm(request.POST)
if form.is_valid():
subject = form.cleaned_data['subject']
message = form.cleaned_data['message']
sender = form.cleaned_data['sender']
recipient = form.cleaned_data['recipient']
send_mail(subject, message, sender, [recipient])
try:
next = form.cleaned_data['next']
except:
next = ''
return HttpResponseRedirect(next)
else:
try:
next = request.GET['next']
except:
next = ''
if request.user.is_authenticated():
sender = request.user.email
else:
sender = ''
form = EmailShareForm(initial={'next':next, 'message':"I'm ungluing books at unglue.it. Here's one of my favorites: "+next, "sender":sender})
if request.method == 'POST':
form=EmailShareForm(request.POST)
if form.is_valid():
subject = form.cleaned_data['subject']
message = form.cleaned_data['message']
sender = form.cleaned_data['sender']
recipient = form.cleaned_data['recipient']
send_mail(subject, message, sender, [recipient])
try:
next = form.cleaned_data['next']
except:
next = ''
return HttpResponseRedirect(next)
else:
try:
next = request.GET['next']
except:
next = ''
if request.user.is_authenticated():
sender = request.user.email
else:
sender = ''
form = EmailShareForm(initial={'next':next, 'message':"I'm ungluing books at unglue.it. Here's one of my favorites: "+next, "sender":sender})
return render(request, "emailshare.html", {'form':form})
return render(request, "emailshare.html", {'form':form})