Merge pull request #4573 from john-bodley/john-bodley-cache-fix-datasource-uid

[cache] Ensuring that the datasource UID is defined
This commit is contained in:
John Bodley 2018-03-13 10:55:40 -07:00 committed by GitHub
commit de4409835e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -277,9 +277,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()