From a3087fc7141f094e0b4e417148940e52145d5c06 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 2 May 2013 17:29:17 -0400 Subject: [PATCH] Fix bug where goal null was untippable; #893 --- gittip/models/participant.py | 4 ++++ templates/participant.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gittip/models/participant.py b/gittip/models/participant.py index 6d524b2731..5f63c7bf97 100644 --- a/gittip/models/participant.py +++ b/gittip/models/participant.py @@ -110,6 +110,10 @@ def tips_receiving(self): return self._tips_receiving.distinct("tips.tipper")\ .order_by("tips.tipper, tips.mtime DESC") + @property + def accepts_tips(self): + return (self.goal is None) or (self.goal >= 0) + @property def valid_tips_receiving(self): ''' diff --git a/templates/participant.html b/templates/participant.html index 1f18a9fe2a..ae2e981079 100644 --- a/templates/participant.html +++ b/templates/participant.html @@ -55,7 +55,7 @@

{{ participant.username }} -{% if participant != user and participant.goal >= 0 %} +{% if (participant != user) and participant.accepts_tips %}