From bd1adb4927695ed0ce3ac94d90c68bd61e440275 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Sat, 14 Oct 2017 11:36:20 -0500 Subject: updated comments app and added caption to photo list view --- app/lib/django_comments/abstracts.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/lib/django_comments/abstracts.py') 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) ) -- cgit v1.2.3-70-g09d2