blob: 49d349b26b47b637fba122b992bb62995ae2cffa [file] [log] [blame]
Sapan Bhatia26d40bc2014-05-12 15:28:02 -04001from core.models import User, UserDeployments
2from observer.deleter import Deleter
3
4class UserDeploymentDeleter(Deleter):
5 model='UserDeployment'
6
7 def call(self, pk):
8 user_deployment = UserDeployments.objects.get(pk=pk)
9 if user_deployment.user.kuser_id:
10 driver = self.driver.admin_driver(deployment=user_deployment.deployment.name)
11 driver.delete_user(user_deployment.user.kuser_id)
12 user_deployment.delete()