Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed CannotChangeVote exception usage which was incorrect and caused…

… a Python exception.

Python exception text was like "Exceptions cannot be types"
  • Loading branch information...
commit 3688518d00a2208bac802b226b99f32540a8fbbe 1 parent 8aa1506
@jpic jpic authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 djangoratings/__init__.py
View
6 djangoratings/__init__.py
@@ -23,7 +23,7 @@ def md5_hexdigest(value):
class InvalidRating(ValueError): pass
class AuthRequired(TypeError): pass
-class CannotChangeVote(object): pass
+class CannotChangeVote(Exception): pass
class Rating(object):
def __init__(self, score, votes):
@@ -152,7 +152,7 @@ def add(self, score, user, ip_address):
rating.score = score
rating.save()
else:
- raise CannotChangeVote
+ raise CannotChangeVote()
else:
has_changed = True
self.votes += 1
@@ -281,4 +281,4 @@ def formfield(self, **kwargs):
class AnonymousRatingField(RatingField):
- allow_anonymous = True
+ allow_anonymous = True
Please sign in to comment.
Something went wrong with that request. Please try again.