Skip to content

Commit

Permalink
fixed bug for device with password=None
Browse files Browse the repository at this point in the history
  • Loading branch information
sunhoww committed Apr 1, 2016
1 parent f98f7f2 commit b55020f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions syncer/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def get_conf(p):
# tmp['id'] = d.id
tmp['name'] = d.name
tmp['number'] = d.number
tmp['commands'] = d.commands()
tmp['alerts'] = d.alerts()
if not d.password is None:
tmp['commands'] = d.commands()
tmp['alerts'] = d.alerts()
resp['devices'].append(tmp)
return resp

Expand Down
2 changes: 1 addition & 1 deletion syncer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def get_msgs(self):
for m in self.messages.all():
tmp = {}
tmp['id'] = m.id
tmp['deviceid'] = m.user.id
tmp['userid'] = m.user.id
tmp['time'] = m.time
tmp['body'] = m.body
tmp['direction'] = m.direction
Expand Down

0 comments on commit b55020f

Please sign in to comment.