From c2636f5bbacb4da195a4cf7125e55b0f1071fdcd Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 7 Sep 2012 01:11:28 -0400 Subject: [PATCH] removed legacy DonateView --- frontend/templates/donate.html | 21 ---------------- frontend/urls.py | 3 +-- frontend/views.py | 44 ---------------------------------- 3 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 frontend/templates/donate.html diff --git a/frontend/templates/donate.html b/frontend/templates/donate.html deleted file mode 100644 index 6eb537e9..00000000 --- a/frontend/templates/donate.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "basedocumentation.html" %} - -{% block title %}Donate{% endblock %} - -{% block extra_extra_head %} -{% endblock %} - -{% block doccontent %} - -

Donate

-

Wonderful: We're glad that you would like to donate to our partnering non-profit.

- -
- {% csrf_token %} - {{form.as_p}} - -
- -{% endblock %} - - diff --git a/frontend/urls.py b/frontend/urls.py index 02115ea7..62f629c6 100644 --- a/frontend/urls.py +++ b/frontend/urls.py @@ -9,7 +9,7 @@ from django.conf import settings from regluit.core.feeds import SupporterWishlistFeed from regluit.core.models import Campaign from regluit.frontend.views import GoodreadsDisplayView, LibraryThingView, PledgeView, PledgeCompleteView, PledgeCancelView, PledgeRechargeView, FAQView -from regluit.frontend.views import CampaignListView, DonateView, WorkListView, UngluedListView, InfoPageView, InfoLangView, DonationView, FundPledgeView +from regluit.frontend.views import CampaignListView, WorkListView, UngluedListView, InfoPageView, InfoLangView, DonationView, FundPledgeView from regluit.frontend.views import NonprofitCampaign, DonationCredit urlpatterns = patterns( @@ -87,6 +87,5 @@ if settings.DEBUG: "regluit.frontend.views", url(r"^goodreads/$", login_required(GoodreadsDisplayView.as_view()), name="goodreads_display"), url(r"^goodreads/clear_wishlist/$","clear_wishlist", name="clear_wishlist"), - url(r"^donate/$", DonateView.as_view(), name="donate"), url(r"^celery/clear/$","clear_celery_tasks", name="clear_celery_tasks"), ) \ No newline at end of file diff --git a/frontend/views.py b/frontend/views.py index f6e815c2..926d2d74 100755 --- a/frontend/views.py +++ b/frontend/views.py @@ -1060,50 +1060,6 @@ class PledgeCancelView(FormView): return HttpResponse("Sorry, something went wrong in canceling your campaign pledge. We have logged this error.") -class DonateView(FormView): - template_name="donate.html" - form_class = DonateForm - - #def get_context_data(self, **kwargs): - # context = super(DonateView, self).get_context_data(**kwargs) - # - # form = CampaignPledgeForm(data) - # - # context.update({'work':work,'campaign':campaign, 'premiums':premiums, 'form':form, 'premium_id':premium_id}) - # return context - - def form_valid(self, form): - donation_amount = form.cleaned_data["donation_amount"] - anonymous = form.cleaned_data["anonymous"] - - # right now, if there is a non-zero pledge amount, go with that. otherwise, do the pre_approval - campaign = None - - p = PaymentManager() - - # we should force login at this point -- or if no account, account creation, login, and return to this spot - if self.request.user.is_authenticated(): - user = self.request.user - else: - user = None - - # instant payment: send to the partnering RH - receiver_list = [{'email':settings.PAYPAL_NONPROFIT_PARTNER_EMAIL, 'amount':donation_amount}] - - #redirect the page back to campaign page on success - return_url = self.request.build_absolute_uri(reverse('donate')) - - t, url = p.pledge('USD', receiver_list, campaign=campaign, list=None, user=user, - return_url=return_url, anonymous=anonymous, ack_name=ack_name, - ack_dedication=ack_dedication) - - if url: - return HttpResponseRedirect(url) - else: - response = t.reference - logger.info("PledgeView paypal: Error " + str(t.reference)) - return HttpResponse(response) - def claim(request): if request.method == 'GET':