+ else:
+ resource = None
+ if app:
+ if getattr(resource, 'error'):
+ return HttpResponseAppRedirect('wolnelekturyapp://paypal_error')
+ else:
+ return HttpResponseAppRedirect('wolnelekturyapp://paypal_return')
+ else:
+ return render(request, 'paypal/return.html', {'resource': resource})