diff options
Diffstat (limited to 'app/lib/django_comments/views')
-rw-r--r-- | app/lib/django_comments/views/comments.py | 6 |
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( |