Commit 48b26b31 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Fix a bug

The user of a NewDeployment can be None
parent bbc68672
......@@ -172,7 +172,9 @@ class NewDeployment(models.Model):
# credentials provided by the backend to the clients
def credentials(self):
if self.user is not None:
return self.user.credentials
return {}
def state(self):
......@@ -306,7 +308,7 @@ class NewDeployment(models.Model):
# sends a state update via RabbitMQ / STOMP to the users webpage instance
def publish_to_user(self):
if self.user is None:
raise ValueError('Unable to publish deployment to None user')
# avoiding circular dependencies here
from .serializers.webpage import NewDeploymentSerializer
......@@ -559,6 +561,7 @@ class NewDeploymentStateItem(models.Model):
def _set_state(self, state, publish=True):
# assure all user credentials have a state
if self.parent.user is not None:
for key in self.parent.user.ssh_keys.all():
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