Browse Source

fix MumbleUsers page crashing when a server is not running, show running state in MumbleServers page

Natenom/support-murmur-13-1446181288462
Michael Ziegler 15 years ago
parent
commit
79945dd224
  1. 15
      pyweb/mumble/admin.py

15
pyweb/mumble/admin.py

@ -22,7 +22,18 @@ from mumble.forms import MumbleServerForm, MumbleAdminForm, MumbleUserAdminForm
from mumble.models import MumbleServer, Mumble, MumbleUser from mumble.models import MumbleServer, Mumble, MumbleUser
class MumbleServerAdmin(admin.ModelAdmin): class MumbleServerAdmin(admin.ModelAdmin):
list_display = [ 'dbus', 'get_murmur_online' ]
search_fields = [ 'dbus' ]
ordering = [ 'dbus' ]
form = MumbleServerForm form = MumbleServerForm
def get_murmur_online( self, obj ):
return obj.online
get_murmur_online.short_description = _('Master is running')
get_murmur_online.boolean = True
class MumbleAdmin(admin.ModelAdmin): class MumbleAdmin(admin.ModelAdmin):
""" Specification for the "Server administration" admin section. """ """ Specification for the "Server administration" admin section. """
@ -113,7 +124,9 @@ class MumbleUserAdmin(admin.ModelAdmin):
form = MumbleUserAdminForm form = MumbleUserAdminForm
def get_acl_admin( self, obj ): def get_acl_admin( self, obj ):
return obj.aclAdmin
if obj.server.booted:
return obj.aclAdmin
return None
get_acl_admin.short_description = _('Admin on root channel') get_acl_admin.short_description = _('Admin on root channel')
get_acl_admin.boolean = True get_acl_admin.boolean = True

Loading…
Cancel
Save