Francesco Banconi  committed db460bb

Fixes to anonymous rating system.

  • Participants
  • Parent commits 36af837
  • Branches default

Comments (0)

Files changed (3)

File ratings/

     mapping = {
         'model': str(instance._meta),
-        'content_type_id': str(,
+        'object_id':,
         'key': key,
     return settings.COOKIE_NAME_PATTERN % mapping

File ratings/forms/

             # votes are handled by cookies
             if not ip_address:
                 raise exceptions.DataError('Invalid ip address')
-            cookie_name = cookies.get_name(self.target_object, key)
+            cookie_name = cookies.get_name(self.target_object, self.key)
             cookie_value = request.COOKIES.get(cookie_name)
             if cookie_value:
                 # the user maybe voted this object (it has a cookie)

File ratings/

         This method is called only if the user does not provide a rating key.
-        return default_key
+        return self.default_key
     def allow_key(self, request, instance, key):
         Called by *success_response* when the vote is by an nonymous user.
         Set the cookie to the response.
-        cookie_name = cookies.get_name(vote.content_object, vote.key)
+        cookie_name = str(cookies.get_name(vote.content_object, vote.key))
         if deleted: