In Graph#bind_to_run, move is_bound check up before new file writing happens
@@ -1344,13 +1344,13 @@ class Graph(Media):
"edges": [edge.to_json() for edge in self.edges]}
def bind_to_run(self, *args, **kwargs):
+ if self.is_bound():
+ return
data = self._to_graph_json()
tmp_path = os.path.join(MEDIA_TMP.name, util.generate_id() + '.graph.json')
data = numpy_arrays_to_lists(data)
util.json_dump_safer(data, codecs.open(tmp_path, 'w', encoding='utf-8'))
self._set_file(tmp_path, is_tmp=True, extension='.graph.json')
- if self.is_bound():
- return
super(Graph, self).bind_to_run(*args, **kwargs)
@classmethod
