From 4cfd24364964010f84bbec028ca6de1c3e92351d Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Sun, 21 Mar 2010 14:35:16 +0100 Subject: [PATCH] fix the order function causing an AttributeError on pre-1.2.1 Murmur servers --- pyweb/mumble/mmobjects.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyweb/mumble/mmobjects.py b/pyweb/mumble/mmobjects.py index 061c669..bde32cc 100644 --- a/pyweb/mumble/mmobjects.py +++ b/pyweb/mumble/mmobjects.py @@ -25,11 +25,11 @@ from django.conf import settings def cmp_channels( left, rite ): """ Compare two channels, first by position, and if that equals, by name. """ - byorder = cmp( left.position, rite.position ); - if byorder != 0: - return byorder; - else: - return cmp_names( left, rite ); + if hasattr( left, "position" ) and hasattr( rite, "position" ): + byorder = cmp( left.position, rite.position ); + if byorder != 0: + return byorder; + return cmp_names( left, rite ); def cmp_names( left, rite ): """ Compare two objects by their name property. """