summaryrefslogtreecommitdiff
path: root/app/lib/django_comments/abstracts.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2017-10-14 11:36:20 -0500
committerluxagraf <sng@luxagraf.net>2017-10-14 11:36:20 -0500
commitbd1adb4927695ed0ce3ac94d90c68bd61e440275 (patch)
treef014fa16a64eb55e62ecb92c62a4e8186cd318a4 /app/lib/django_comments/abstracts.py
parentcbadfff80be33b4ec67da57585451884c6378380 (diff)
updated comments app and added caption to photo list view
Diffstat (limited to 'app/lib/django_comments/abstracts.py')
-rw-r--r--app/lib/django_comments/abstracts.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/lib/django_comments/abstracts.py b/app/lib/django_comments/abstracts.py
index 8004204..4fbb94a 100644
--- a/app/lib/django_comments/abstracts.py
+++ b/app/lib/django_comments/abstracts.py
@@ -4,11 +4,14 @@ from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
-from django.core import urlresolvers
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
+try:
+ from django.urls import reverse
+except ImportError:
+ from django.core.urlresolvers import reverse # Django < 1.10
from .managers import CommentManager
@@ -39,7 +42,7 @@ class BaseCommentAbstractModel(models.Model):
"""
Get a URL suitable for redirecting to the content object.
"""
- return urlresolvers.reverse(
+ return reverse(
"comments-url-redirect",
args=(self.content_type_id, self.object_pk)
)