summaryrefslogtreecommitdiff
path: root/app/lib/django_comments/views
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2015-10-25 08:40:00 -0400
committerluxagraf <sng@luxagraf.net>2015-10-25 08:40:00 -0400
commitf03cf2d8ad179e1a5f672b7f719b80252a788719 (patch)
tree1775aac397f01ae2034a3e63d93d26f13e43b763 /app/lib/django_comments/views
parentcab3e764123a5ed8d3d634bced9857c8989331b4 (diff)
updated comments to work with django 1.9
Diffstat (limited to 'app/lib/django_comments/views')
-rw-r--r--app/lib/django_comments/views/comments.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/lib/django_comments/views/comments.py b/app/lib/django_comments/views/comments.py
index 92084b6..b44babf 100644
--- a/app/lib/django_comments/views/comments.py
+++ b/app/lib/django_comments/views/comments.py
@@ -10,6 +10,10 @@ from django.template.loader import render_to_string
from django.utils.html import escape
from django.views.decorators.csrf import csrf_protect
from django.views.decorators.http import require_POST
+try:
+ from django.apps import apps
+except ImportError:
+ from django.db import models as apps
import django_comments
from django_comments import signals
@@ -49,7 +53,7 @@ def post_comment(request, next=None, using=None):
if ctype is None or object_pk is None:
return CommentPostBadRequest("Missing content_type or object_pk field.")
try:
- model = models.get_model(*ctype.split(".", 1))
+ model = apps.get_model(*ctype.split(".", 1))
target = model._default_manager.using(using).get(pk=object_pk)
except TypeError:
return CommentPostBadRequest(