diff --git a/superset/viz.py b/superset/viz.py index a97b04e985014..8bb65824d1a5b 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -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'))