Fix: delete data source CLI failing when data source has references

This commit is contained in:
Arik Fraimovich 2016-02-09 00:03:35 +02:00
parent ded4761c8a
commit d4a83e29d4

View File

@ -95,7 +95,7 @@ def delete(name):
try:
data_source = models.DataSource.get(models.DataSource.name==name)
print "Deleting data source: {} (id={})".format(name, data_source.id)
data_source.delete_instance()
data_source.delete_instance(recursive=True)
except models.DataSource.DoesNotExist:
print "Couldn't find data source named: {}".format(name)
@ -129,4 +129,3 @@ def edit(name, new_name=None, options=None, type=None):
except models.DataSource.DoesNotExist:
print "Couldn't find data source named: {}".format(name)