Browse Source

fix parent ID not being set in the JSON.

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
b14a168f0c
  1. 8
      pyweb/mumble/views.py

8
pyweb/mumble/views.py

@ -333,11 +333,17 @@ def mmng_tree( request, server ):
for chanid in srv.channels: for chanid in srv.channels:
channel = srv.channels[chanid] channel = srv.channels[chanid]
state = None # "removed" state = None # "removed"
if channel.parent is not None:
parent = channel.parent.chanid
else:
parent = -1
chanlist.append({ chanlist.append({
"type": "channel", "type": "channel",
"id": channel.chanid, "id": channel.chanid,
"name": channel.name, "name": channel.name,
"parent": channel.parent and channel.parent.chanid or -1,
"parent": parent,
"position": channel.position, "position": channel.position,
"state": state == None and (channel.temporary and "temporary" or "permanent") or state "state": state == None and (channel.temporary and "temporary" or "permanent") or state
}) })

Loading…
Cancel
Save