Permalink
Browse files

Servers: Json the username

  • Loading branch information...
1 parent f15a7fc commit 62ecba9f4689f74a32ff46611c78cee68155953c @kylef kylef committed Aug 8, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 servers/models.py
View
@@ -41,12 +41,13 @@ def as_dict(self):
result = {}
for field in ('name', 'ipv4', 'ipv6', 'tor', 'ssh_rsa_fingerprint',
- 'ssh_dsa_fingerprint', 'is_online', 'location', 'owner'):
+ 'ssh_dsa_fingerprint', 'is_online', 'location'):
if getattr(self, field, None):
result[field] = getattr(self, field)
tags = [tag.name for tag in self.tags.all()]
if tags and self.is_online:
result['tags'] = tags
+ result['owner'] = self.owner.username
return result

0 comments on commit 62ecba9

Please sign in to comment.