blob: 3f93060862aa5b3baa748af22c33f3794295aa33 [file] [log] [blame]
Sapan Bhatia6bfa2ca2014-11-11 21:47:45 -05001from core.models import User, UserDeployment
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04002from observer.deleter import Deleter
3from observer.deleters.user_deployment_deleter import UserDeploymentDeleter
4
5class UserDeleter(Deleter):
6 model='User'
7
8 def call(self, pk):
9 user = User.objects.get(pk=pk)
10 user_deployment_deleter = UserDeploymentDeleter()
Sapan Bhatiabfe716a2014-11-11 21:44:35 -050011 for user_deployment in UserDeployment.objects.filter(user=user):
Sapan Bhatia26d40bc2014-05-12 15:28:02 -040012 user_deployment_deleter(user_deployment.id)
13 user.delete()