Fix delete_user call to remove all user data

This commit is contained in:
Joseph Schorr 2015-11-08 13:10:01 -05:00
parent 8019994462
commit 8463514a09

View file

@ -651,9 +651,12 @@ def detach_external_login(user, service_name):
def delete_user(user):
user.delete_instance(recursive=True, delete_nullable=True)
# Delete any repositories under the user's namespace.
for repo in list(Repository.select().where(Repository.namespace_user == user)):
repository.purge_repository(user.username, repo.name)
# TODO: also delete any repository data associated
# Delete the user itself.
user.delete_instance(recursive=True, delete_nullable=True)
def get_pull_credentials(robotname):