blob: 3573f8d031d8c48a3184d84638c24e57dafc3537 [file] [log] [blame]
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04001from core.models import User, UserDeployments
2from 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()
11 for user_deployment in UserDeployments.objects.filter(user=user):
12 user_deployment_deleter(user_deployment.id)
13 user.delete()