Skip to content

Commit

Permalink
Make all suggestions able to be purchased
Browse files Browse the repository at this point in the history
Temporary solution until #37 is fixed
  • Loading branch information
JustDerb committed Apr 18, 2014
1 parent 75c86e6 commit d54cc52
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def get_winning_suggestions(current_balance):
buyable_suggestions = Suggestion.objects.filter(price__lte=current_balance)
nonpurchased_suggestions = buyable_suggestions.filter(purchase=None)
suggestions_by_votes = nonpurchased_suggestions.annotate(votes=Sum('vote__value'))
max_votes = suggestions_by_votes.aggregate(Max('votes'))['votes__max']
return suggestions_by_votes.filter(votes=max_votes)
return suggestions_by_votes

class KegDetail(DetailView):
model = Suggestion
Expand Down

0 comments on commit d54cc52

Please sign in to comment.