Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
put back has_purchased and can_review
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy McKay committed Sep 7, 2011
1 parent 0f283e4 commit db97f92
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apps/addons/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,13 @@ def upsold(self):
except IndexError:
pass

def has_purchased(self, user):
return (self.is_premium() and
self.addonpurchase_set.filter(user=user).exists())

def can_review(self, user):
return not self.is_premium() or self.has_purchased(user)

@property
def all_dependencies(self):
"""Return all the add-ons this add-on depends on."""
Expand Down

0 comments on commit db97f92

Please sign in to comment.