Commit 00a1f04b authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Fix bug in rest update

parent b2032c60
...@@ -73,26 +73,27 @@ class Site(models.Model): ...@@ -73,26 +73,27 @@ class Site(models.Model):
services = {} services = {}
for service in self.services.all(): for service in self.services.all():
deployments = ( ds = (
service.deployments service.deployments
# only oidcuser are supposed to have deployments
.filter(user__user_type='oidcuser') .filter(user__user_type='oidcuser')
# we do not exclude deployments without ssh_keys, as the # we do not exclude deployments without ssh_keys, as the
# ssh_keys_to_withdraw still need to be propagated # ssh_keys_to_withdraw still need to be propagated
# .exclude(ssh_keys=None) # .exclude(ssh_keys=None)
) )
print(ds)
if not all: if not all:
deployments = deployments.filter( ds = ds.filter(
last_change__gt=self.last_fetch) last_change__gt=self.last_fetch)
# deployments for this site for deployment in ds:
services[service.name] = deployments
for deployment in deployments.all():
# TODO replace this optimism with an acknowledgement # TODO replace this optimism with an acknowledgement
deployment.client_updated() deployment.client_updated()
# TODO we expect the client to get the update here # deployments for this site
self.client_updated() services[service.name] = ds
return services return services
......
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