Commit ba695f2d authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Add trigger to rest api to delete keys

parent 2bb1f80a
......@@ -66,7 +66,7 @@ class Site(models.Model):
services = {}
for service in self.services.all():
ds = (
deployments = (
service.deployments
.filter(user__user_type='oidcuser')
# we do not exclude deployments without ssh_keys, as the
......@@ -74,10 +74,15 @@ class Site(models.Model):
# .exclude(ssh_keys=None)
)
if not all:
ds = ds.filter(last_change__gt=self.last_fetch)
deployments = deployments.filter(
last_change__gt=self.last_fetch)
# deployments for this site
services[service.name] = ds
services[service.name] = deployments
for deployment in deployments.all():
# TODO replace this optimism with an acknowledgement
deployment.client_got_deployment()
self.last_fetch = datetime.now()
self.save()
......
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