Skip to content

Commit bc5f72b

Browse files
committed
fix(controller): rename destroy() to delete() and call its super()
To ensure that we destroy containers and fleet jobs when deleting an app, do so in the Django model method delete(), not the REST API-ish destroy() which was not connected to anything.
1 parent df5aa92 commit bc5f72b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

controller/api/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ def create(self, *args, **kwargs):
121121
build = Build.objects.create(owner=self.owner, app=self, image=settings.DEFAULT_BUILD)
122122
Release.objects.create(version=1, owner=self.owner, app=self, config=config, build=build)
123123

124-
def destroy(self, *args, **kwargs):
124+
def delete(self, *args, **kwargs):
125125
for c in self.container_set.all():
126126
c.destroy()
127+
return super(App, self).delete(*args, **kwargs)
127128

128129
def deploy(self, release):
129130
tasks.deploy_release.delay(self, release).get()

0 commit comments

Comments
 (0)