[cache] Ensuring that the datasource UID is defined

This commit is contained in:
John Bodley 2018-03-07 23:29:23 -08:00
parent b63dc91cd1
commit 26257d94f5
1 changed files with 2 additions and 1 deletions

View File

@ -276,9 +276,10 @@ class BaseViz(object):
for k in ['from_dttm', 'to_dttm']:
del cache_dict[k]
for k in ['since', 'until', 'datasource']:
for k in ['since', 'until']:
cache_dict[k] = self.form_data.get(k)
cache_dict['datasource'] = self.datasource.uid
json_data = self.json_dumps(cache_dict, sort_keys=True)
return hashlib.md5(json_data.encode('utf-8')).hexdigest()