mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
[soc2009/multidb] Added using argument to comment view. Patch from Russell Keith-Magee.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11894 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
bdf21ccf8b
commit
e4dc8be3a9
@ -25,7 +25,7 @@ class CommentPostBadRequest(http.HttpResponseBadRequest):
|
||||
|
||||
@csrf_protect
|
||||
@require_POST
|
||||
def post_comment(request, next=None):
|
||||
def post_comment(request, next=None, using=None):
|
||||
"""
|
||||
Post a comment.
|
||||
|
||||
@ -50,7 +50,7 @@ def post_comment(request, next=None):
|
||||
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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user