From 4dda6a212aca22661a8b4e9084e1960b281da74a Mon Sep 17 00:00:00 2001 From: Michael Ziegler Date: Mon, 29 Mar 2010 10:14:12 +0200 Subject: [PATCH] fix the user registration field lookups --- pyweb/mumble/models.py | 4 ++-- pyweb/mumble/utils.py | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pyweb/mumble/models.py b/pyweb/mumble/models.py index d9d5df3..0c59cc2 100644 --- a/pyweb/mumble/models.py +++ b/pyweb/mumble/models.py @@ -536,8 +536,8 @@ def mk_registration_property( field, doc="" ): """ Create a property for the given registration field. """ def get_field( self ): - if "comment" in self.registration: - return self.registration["comment"]; + if field in self.registration: + return self.registration[field]; else: return None; diff --git a/pyweb/mumble/utils.py b/pyweb/mumble/utils.py index eb72068..4f2b36b 100644 --- a/pyweb/mumble/utils.py +++ b/pyweb/mumble/utils.py @@ -28,3 +28,9 @@ class ObjectInfo( object ): def __unicode__( self ): return unicode( self.__dict__ ); + + def __contains__( self, name ): + return name in self.__dict__; + + def __getitem__( self, name ): + return self.__dict__[name];