Pass session to getTemps

This commit is contained in:
Matthew Dillon 2015-10-10 09:30:25 -07:00
parent 2ec63cc0e3
commit c55ab31671
2 changed files with 8 additions and 7 deletions

View file

@ -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

View file

@ -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)