Commit 1d0fdc4d authored by Lukas Burgey's avatar Lukas Burgey

Change some __str__ methods

parent e7a3b0f4
......@@ -754,7 +754,9 @@ class Deployment(models.Model):
state.remove()
def __str__(self):
return '{}:{}'.format(self.service, self.user)
if self.service is not None:
return '{}:{}'.format(self.service, self.user)
return '{}:{}'.format(self.group, self.user)
def msg(self, msg):
return '[Depl.m:{}] {}'.format(self, msg)
......@@ -903,8 +905,14 @@ class DeploymentState(models.Model):
self.save()
def __str__(self):
if self.service is not None:
return "{}:{}#{}".format(
self.service,
self.key,
self.id,
)
return "{}:{}#{}".format(
self.deployment.service,
self.group,
self.key,
self.id,
)
......@@ -1040,11 +1048,18 @@ class DeploymentStateItem(models.Model):
if publish:
self.parent.publish_to_user()
def __str__(self):
if self.group is not None:
return "{}:{}:{}@{}#{}".format(
self.group,
self.service,
self.key,
self.site,
self.id,
)
return "{}:{}@{}#{}".format(
self.parent.service,
self.parent.key,
self.service,
self.key,
self.site,
self.id,
)
......
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