Commits

Anonymous committed edde506

[soc2009/multidb] Added using argument to comment view. Patch from Russell Keith-Magee.

Comments (0)

Files changed (1)

django/contrib/comments/views/comments.py

 
 @csrf_protect
 @require_POST
-def post_comment(request, next=None):
+def post_comment(request, next=None, using=None):
     """
     Post a comment.
 
         return CommentPostBadRequest("Missing content_type or object_pk field.")
     try:
         model = models.get_model(*ctype.split(".", 1))
-        target = model._default_manager.get(pk=object_pk)
+        target = model._default_manager.using(using).get(pk=object_pk)
     except TypeError:
         return CommentPostBadRequest(
             "Invalid content_type value: %r" % escape(ctype))