Commit 6be09f81 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Clean up the deletion of ssh keys

parent 580739c0
......@@ -79,8 +79,7 @@ class SSHPublicKeyView(views.APIView):
# key state: -> (1), if there are no deployments
# key state: -> (5), if there are deployments
key.deleted = True
return state_response(request)
elif request_type == 'add':
if 'key' in
......@@ -186,6 +186,15 @@ class SSHPublicKey(models.Model):
# does not directly delete the key, but merely starts the deletion process
# the receiver 'delete_old_ssh_key' does the actual deletion afterwards
def delete_key(self):
self.deleted = True
for deployment in self.deployments.all():
def __str__(self):
if self.deleted:
return "DELETED: {}".format(
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment