Browse Source

/mumble now redirects to /mumble/x if only one server has been configured

Natenom/support-murmur-13-1446181288462
Michael Ziegler 16 years ago
parent
commit
72df6d5cc8
  1. 9
      pyweb/mumble/views.py

9
pyweb/mumble/views.py

@ -34,10 +34,15 @@ class Storage( object ):
def mumbles( request ): def mumbles( request ):
"Displays a list of all configured Mumble servers."
"Displays a list of all configured Mumble servers, or redirects if only one configured."
mumbles = get_list_or_404( Mumble );
if len(mumbles) == 1:
return HttpResponseRedirect( '/mumble/%d' % mumbles[0].id );
return render_to_response( return render_to_response(
'mumble/list.htm', 'mumble/list.htm',
{ 'MumbleObjects': get_list_or_404( Mumble ),
{ 'MumbleObjects': mumbles,
'MumbleActive': True, 'MumbleActive': True,
}, },
context_instance = RequestContext(request) context_instance = RequestContext(request)

Loading…
Cancel
Save