Commit a2dc53a3 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add deletion hack to users

parent 50740229
......@@ -165,6 +165,31 @@ class User(AbstractUser):
return client
def delete(self, *args, **kwargs):'Deleting User %s', self)
from . import deployments
# TODO these deletions are a hack. django should (TM) be able to delete them itself
# but there seems to be a bug
for dep in deployments.ServiceDeployment.objects.filter(user=self):
LOGGER.debug('Deleting users service deployment %s', dep)
for dep in deployments.VODeployment.objects.filter(user=self):
LOGGER.debug('Deleting users vo deployment %s', dep)
for dep in deployments.Deployment.objects.filter(user=self):
LOGGER.debug('Deleting users deployment %s', dep)
dep.delete()'User has: %s', self.deployments.all())
for dep in self.deployments.all():
super(User, self).delete(*args, **kwargs)
def __str__(self):
name = ''
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment