Skip to content

Commit

Permalink
removed dependency on functools
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesturk committed Jan 23, 2009
1 parent a054930 commit 936ed70
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions secretballot/__init__.py
@@ -1,9 +1,7 @@
from secretballot.models import Vote
from functools import partial

def total_vote_limiter(request, content_type, object_id, vote, num):
return Vote.objects.filter(content_type=content_type,
token=request.secretballot_token).count() < num

def limit_total_votes(num_votes):
return partial(total_vote_limiter, num=num_votes)
def limit_total_votes(num):
def total_vote_limiter(request, content_type, object_id, vote):
return Vote.objects.filter(content_type=content_type,
token=request.secretballot_token).count() < num
return total_vote_limiter

0 comments on commit 936ed70

Please sign in to comment.