blob: 3573f8d031d8c48a3184d84638c24e57dafc3537 [file] [log] [blame]
Tony Mackbdb188a2014-04-01 20:24:47 -04001from core.models import User, UserDeployments
Tony Mack387a73f2013-09-18 07:59:14 -04002from observer.deleter import Deleter
Tony Mack79e78c82014-04-12 10:26:15 -04003from observer.deleters.user_deployment_deleter import UserDeploymentDeleter
Tony Mack387a73f2013-09-18 07:59:14 -04004
5class UserDeleter(Deleter):
6 model='User'
7
8 def call(self, pk):
9 user = User.objects.get(pk=pk)
Tony Mack79e78c82014-04-12 10:26:15 -040010 user_deployment_deleter = UserDeploymentDeleter()
11 for user_deployment in UserDeployments.objects.filter(user=user):
12 user_deployment_deleter(user_deployment.id)
Tony Mack387a73f2013-09-18 07:59:14 -040013 user.delete()