From: hernani Date: Fri, 15 Jul 2011 16:34:44 +0000 (+0000) Subject: Fixes a bug where some suspended users where throwing 500's. X-Git-Tag: live~192 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/058d024a4d9310c66155b852eab73b3373ec3266?hp=f1defc59ca7a7b15e17e8a59c72a726ae937d8e5 Fixes a bug where some suspended users where throwing 500's. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1121 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/models/user.py b/forum/models/user.py index 84801fb..b3822a1 100644 --- a/forum/models/user.py +++ b/forum/models/user.py @@ -410,7 +410,7 @@ class User(BaseModel, DjangoUser): except MultipleObjectsReturned: logging.error("Multiple suspension actions found for user %s (%s)" % (self.username, self.id)) self.__dict__['_suspension_dencache_'] = self.reputes.filter(action__action_type="suspend", action__canceled=False - ).order_by('-action__action_date')[0] + ).order_by('-action__action_date')[0].action return self.__dict__['_suspension_dencache_']