Commit f3e834a1 authored by Ulises Morales Ramírez's avatar Ulises Morales Ramírez

Merge branch 'ipn_paypal' into 'dev'

Ipn paypal

See merge request !9
parents 3c7cba87 359d395c
# project # project
.idea/ .idea/
config/
geosentinel/ geosentinel/
geosentinel geosentinel
db.sqlite3-journal db.sqlite3-journal
......
...@@ -201,9 +201,9 @@ ...@@ -201,9 +201,9 @@
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<!--td> <td>
<a href="../pay" class="btn btn-primary pull-right">Pay</a> <a href="../pay" class="btn btn-primary pull-right">Pay</a>
</td--> </td>
<td class="text-center"> <td class="text-center">
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="cmd" value="_cart">
......
...@@ -13,10 +13,6 @@ from django.contrib.auth.models import User ...@@ -13,10 +13,6 @@ from django.contrib.auth.models import User
import requests, json, unicodedata, sys, base64 import requests, json, unicodedata, sys, base64
import os import os
from geosentinel import APISentinel, polygonToBox from geosentinel import APISentinel, polygonToBox
import cgi
import collections
import urllib
from urllib import parse ########### lee archivo de configuración ################
dirname = os.path.dirname(__file__) dirname = os.path.dirname(__file__)
configfile = os.path.join(dirname, '../config/config.json') configfile = os.path.join(dirname, '../config/config.json')
......
...@@ -377,7 +377,9 @@ ...@@ -377,7 +377,9 @@
if (!firstPoint) return; if (!firstPoint) return;
label = myChart.data.labels[firstPoint._index]; label = myChart.data.labels[firstPoint._index];
document.getElementById("satImage").src = "../../static/reports/tmpImages/" + label + "_TCI_60m.jpg" //alert("{{ IMAGE_PATH }}"+label+"_TCI_60m.jpg");
document.getElementById("satImage").src = "{{ IMAGE_PATH }}"+label+"_TCI_60m.jpg";
//document.getElementById("satImage").src = "../../static/reports/tmpImages/" + label + "_TCI_60m.jpg"
}; };
// cambiar el tipo de gráfica // cambiar el tipo de gráfica
......
...@@ -30,6 +30,7 @@ USERS_PATH = config['PATHS']['PATH_USERS'] ...@@ -30,6 +30,7 @@ USERS_PATH = config['PATHS']['PATH_USERS']
def report_L2ASCL(request, report,purchase_id): def report_L2ASCL(request, report,purchase_id):
image_path =USERS_PATH + request.user.email+"/"+purchase_id+"/"+"out/T15QZD/TCI/"
with open(USERS_PATH + request.user.email+"/"+purchase_id+"/" + report + ".json") as f: with open(USERS_PATH + request.user.email+"/"+purchase_id+"/" + report + ".json") as f:
json_data = OrderedDict(json.load(f)) json_data = OrderedDict(json.load(f))
graphData = dict() graphData = dict()
...@@ -66,7 +67,7 @@ def report_L2ASCL(request, report,purchase_id): ...@@ -66,7 +67,7 @@ def report_L2ASCL(request, report,purchase_id):
# graphData['options']['maintainAspectRatio']=False # graphData['options']['maintainAspectRatio']=False
# print(json.dumps(graphData).encode("utf-8")) # print(json.dumps(graphData).encode("utf-8"))
return render(request, 'L2ASCL_data.html', {"graphData": json.dumps(graphData), "report_name": report}) return render(request, 'L2ASCL_data.html', {"graphData": json.dumps(graphData), "report_name": report, "IMAGE_PATH": image_path})
# -------------------------------------------------------------------------------def Reports(request): # -------------------------------------------------------------------------------def Reports(request):
...@@ -74,7 +75,6 @@ def report_L2ASCL(request, report,purchase_id): ...@@ -74,7 +75,6 @@ def report_L2ASCL(request, report,purchase_id):
def Reports(request): def Reports(request):
productList=[] productList=[]
product_list = Purchase.objects.values('id','productList','aggreg_date','search__clouds' ,'search__startDate', 'search__endDate','search__process_id__name').filter(user_id=request.user.id, purchased=1) product_list = Purchase.objects.values('id','productList','aggreg_date','search__clouds' ,'search__startDate', 'search__endDate','search__process_id__name').filter(user_id=request.user.id, purchased=1)
print(product_list)
for producto in product_list: for producto in product_list:
size = 0 size = 0
for p in json.loads(producto['productList']): for p in json.loads(producto['productList']):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment