Skip to content

Commit

Permalink
[bugfix] empty From date filter NoneType error
Browse files Browse the repository at this point in the history
Error "AttributeError: 'NoneType' object has no attribute 'split'" is
fired.
  • Loading branch information
mistercrunch committed Oct 10, 2017
1 parent 64ef8b1 commit 73b17ef
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,11 @@ def query_obj(self):
until = form_data.get("until", "now")

# Backward compatibility hack
since_words = since.split(' ')
grains = ['days', 'years', 'hours', 'day', 'year', 'weeks']
if (len(since_words) == 2 and since_words[1] in grains):
since += ' ago'
if since:
since_words = since.split(' ')
grains = ['days', 'years', 'hours', 'day', 'year', 'weeks']
if (len(since_words) == 2 and since_words[1] in grains):
since += ' ago'

from_dttm = utils.parse_human_datetime(since)

Expand Down

0 comments on commit 73b17ef

Please sign in to comment.