diff --git a/app/main/utils.py b/app/main/utils.py index c31b02c..a1fcdcd 100644 --- a/app/main/utils.py +++ b/app/main/utils.py @@ -3,9 +3,13 @@ import numpy from .models import DB -def getTemps(datasets, community_id, minyear, maxyear): - model, scenario = datasets.split(',') - data = DB.getTemps(minyear, maxyear, community_id, model, scenario) +def getTemps(session): + model, scenario = session['datasets'].split(',') + data = DB.getTemps(session['minyear'], + session['maxyear'], + session['community_data']['id'], + model, + scenario) return data diff --git a/app/main/views.py b/app/main/views.py index 6da95e6..078fb82 100644 --- a/app/main/views.py +++ b/app/main/views.py @@ -31,10 +31,7 @@ def index(): session['ds_name'] = session['datasets'].split(',') - temps_arr = getTemps(session['datasets'], - community_id, - session['minyear'], - session['maxyear']) + temps_arr = getTemps(session) session['avg_temp'] = avg_air_temp(temps_arr) indices = ann_air_indices(temps_arr)