Permalink
Browse files

Fixing for Django 1.5

  • Loading branch information...
1 parent 0df5b2a commit 15f2e24178458ea855ed8c4ea130e4201bc0b807 @radiosilence radiosilence committed Mar 5, 2013
@@ -1,13 +1,12 @@
from django.http import HttpResponseRedirect
-from django.shortcuts import get_object_or_404
-from django.views.generic.simple import direct_to_template
+from django.shortcuts import get_object_or_404, render
from mamona.models import Payment
from models import DummyTxn
def decide_success_or_failure(request, payment_id):
payment = get_object_or_404(Payment, id=payment_id, status='in_progress', backend='dummy')
- return direct_to_template(
+ return render(
request,
'mamona/backends/dummy/decide.html',
{'payment': payment}
@@ -1,6 +1,5 @@
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound
-from django.shortcuts import get_object_or_404
-from django.views.generic.simple import direct_to_template
+from django.shortcuts import get_object_or_404, render
from django.views.decorators.csrf import csrf_exempt
from mamona.models import Payment
@@ -24,7 +23,7 @@ def return_from_gw(request, payment_id):
return HttpResponseRedirect(urls['partially_paid'])
except KeyError:
return HttpResponseRedirect(urls['paid'])
- return direct_to_template(
+ return render(
request,
'mamona/base_return.html',
{'payment': payment}
@@ -9,7 +9,7 @@
{% trans "Would you like to finish this payment with success or failure?" %}
</p>
<p>
-<a href="{% url mamona-dummy-do-success payment.id %}">{% trans "Success" %}</a>
-<a href="{% url mamona-dummy-do-failure payment.id %}">{% trans "Failure" %}</a>
+<a href="{% url 'mamona-dummy-do-success' payment.id %}">{% trans "Success" %}</a>
+<a href="{% url 'mamona-dummy-do-failure' payment.id %}">{% trans "Failure" %}</a>
</p>
{% endblock %}
View
@@ -1,8 +1,7 @@
from django.conf import settings
from django.http import HttpResponseNotFound, HttpResponseRedirect
from django.core.urlresolvers import reverse
-from django.shortcuts import get_object_or_404
-from django.views.generic.simple import direct_to_template
+from django.shortcuts import get_object_or_404, render
from models import Payment, Order, payment_from_order
from forms import PaymentMethodForm
@@ -42,7 +41,7 @@ def process_payment(request, payment_id):
bknd_form.save()
return HttpResponseRedirect(
reverse('mamona-confirm-payment', kwargs={'payment_id': payment.id}))
- return direct_to_template(
+ return render(
request,
'mamona/select_payment_method.html',
{'payment': payment, 'form': bknd_form},
@@ -51,5 +50,5 @@ def process_payment(request, payment_id):
def confirm_payment(request, payment_id):
payment = get_object_or_404(Payment, id=payment_id, status='new')
formdata = payment.get_processor().get_confirmation_form(payment)
- return direct_to_template(request, 'mamona/confirm.html',
+ return render(request, 'mamona/confirm.html',
{'formdata': formdata, 'payment': payment})

0 comments on commit 15f2e24

Please sign in to comment.