Skip to content

Commit

Permalink
Closes #3294: Set schedule appropriately for forked queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina Samuel committed Jan 16, 2019
1 parent 823e4cc commit c0f424d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions redash/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,16 @@ def get_by_id(cls, _id):
def fork(self, user):
forked_list = ['org', 'data_source', 'latest_query_data', 'description',
'query_text', 'query_hash', 'options']

kwargs = {a: getattr(self, a) for a in forked_list}
default_schedule = MutableDict({
'interval': None,
'until': None,
'day_of_week': None,
'time': None
})
forked_query = Query.create(name=u'Copy of (#{}) {}'.format(self.id, self.name),
schedule=default_schedule,
user=user, **kwargs)

for v in self.visualizations:
Expand Down

0 comments on commit c0f424d

Please sign in to comment.