Skip to content

Commit

Permalink
fix since or until is empty value apache#4170
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Jan 9, 2018
1 parent c49fb0a commit 50c5c51
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ def query_obj(self):

self.time_shift = utils.parse_human_timedelta(time_shift)

from_dttm = utils.parse_human_datetime(since) - self.time_shift
to_dttm = utils.parse_human_datetime(until) - self.time_shift
since = utils.parse_human_datetime(since)
until = utils.parse_human_datetime(until)
from_dttm = None if since is None else (since - self.time_shift)
to_dttm = None if until is None else (until - self.time_shift)
if from_dttm and to_dttm and from_dttm > to_dttm:
raise Exception(_('From date cannot be larger than to date'))

Expand Down

0 comments on commit 50c5c51

Please sign in to comment.