parchado de errores

parent cb184636
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
class="hidden" {% endif %}> class="hidden" {% endif %}>
<a title="View Report" <a title="View Report"
{% if product.initial_folder %} {% if product.initial_folder %}
href="../reports/{{ product.purchase_id }}/{{ product.initial_folder }}_sclData" href="../reports/{{ product.purchase_id }}/{{ product.initial_folder }}"
{% endif %} {% endif %}
class="btn btn-success"> class="btn btn-success">
<i class="fa fa-eye"></i> <i class="fa fa-eye"></i>
......
...@@ -47,6 +47,14 @@ def report_L2ASCL(request, report, purchase_id): ...@@ -47,6 +47,14 @@ def report_L2ASCL(request, report, purchase_id):
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))
if len(json_data)==0:
graphData = ""
defaultLabel=""
defaultDataset=""
folders.remove(reporteDir)
else:
print("lleno")
graphData = dict() graphData = dict()
graphData['type'] = "line" graphData['type'] = "line"
...@@ -97,12 +105,11 @@ def report_L2ASCL(request, report, purchase_id): ...@@ -97,12 +105,11 @@ def report_L2ASCL(request, report, purchase_id):
# -------------------------------------------------------------------------------def Reports(request): # -------------------------------------------------------------------------------def Reports(request):
def Reports(request): def Reports(request):
progress = 0 progress = 0
productList = [] productList = []
size = 0 size = 0
folders=[]
product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds', 'search__startDate', product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds', 'search__startDate',
'search__endDate', 'search__process_id__name').filter( 'search__endDate', 'search__process_id__name').filter(
user_id=request.user.id, purchased=1) user_id=request.user.id, purchased=1)
...@@ -143,8 +150,11 @@ def Reports(request): ...@@ -143,8 +150,11 @@ def Reports(request):
print("folder out noes not exists") print("folder out noes not exists")
else: else:
folders = os.listdir(path=absolute_path) folders = os.listdir(path=absolute_path)
for folder in folders: if len(folders)==0:
initial_folder=folder initial_folder="../#"
else:
initial_folder = folders.pop(0)+"_sclData"
productList.append({ productList.append({
"process": producto['search__process_id__name'], "process": producto['search__process_id__name'],
......
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