Replace get_profile() hack with a test on the user instead, this

also makes the ballot icon more robust against users without profiles
(which shouldn't happen, but apparently we sometimes get one which
results in a crash rather than something more graceful)
 - Legacy-Id: 4480
This commit is contained in:
Ole Laursen 2012-06-20 12:26:06 +00:00
parent 35eb4f013a
commit 822fd6daac

View file

@ -101,7 +101,7 @@ def render_ballot_icon(user, doc):
c = "position-%s" % (pos.pos.slug if pos else "norecord")
if hasattr(user, "get_profile") and ad == user.get_profile():
if ad.user_id == user.id:
c += " my"
res.append('<td class="%s" />' % c)