mirror of https://github.com/apache/superset.git
[Fix] merge since,until request parameter with time_range (#6251)
This commit is contained in:
parent
02f0616025
commit
7d8e3219fc
|
@ -1033,6 +1033,15 @@ class Superset(BaseSupersetView):
|
|||
slc = db.session.query(models.Slice).filter_by(id=slice_id).first()
|
||||
slice_form_data = slc.form_data.copy()
|
||||
# allow form_data in request override slice from_data
|
||||
# special treat for since/until and time_range parameter:
|
||||
# we need to breakdown time_range into since/until so request parameters
|
||||
# has precedence over slice parameters for time fields.
|
||||
if 'time_range' in form_data:
|
||||
form_data['since'], separator, form_data['until'] = \
|
||||
form_data['time_range'].partition(' : ')
|
||||
if 'time_range' in slice_form_data:
|
||||
slice_form_data['since'], separator, slice_form_data['until'] = \
|
||||
slice_form_data['time_range'].partition(' : ')
|
||||
slice_form_data.update(form_data)
|
||||
form_data = slice_form_data
|
||||
|
||||
|
|
Loading…
Reference in New Issue