Commit fd9bb87d by benjaoming

Revert "Add use __str__ with python_2_unicode_compatible for plugins too"

parent 588e6933
......@@ -5,7 +5,6 @@ import os.path
from django.conf import settings as django_settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from . import settings
......@@ -27,8 +26,6 @@ def upload_path(instance, filename):
upload_path = os.path.join(upload_path, uuid.uuid4().hex)
return os.path.join(upload_path, filename)
@python_2_unicode_compatible
class Image(RevisionPlugin):
# The plugin system is so awesome that the inheritor doesn't need to do
......@@ -48,12 +45,10 @@ class Image(RevisionPlugin):
if settings.APP_LABEL:
app_label = settings.APP_LABEL
def __str__(self):
def __unicode__(self):
title = (_('Image: %s') % self.current_revision.imagerevision.get_filename()) if self.current_revision else _('Current revision not set!!')
return str(title)
@python_2_unicode_compatible
class ImageRevision(RevisionPluginRevision):
image = models.ImageField(upload_to=upload_path,
......@@ -105,7 +100,7 @@ class ImageRevision(RevisionPluginRevision):
app_label = settings.APP_LABEL
ordering = ('-created',)
def __str__(self):
def __unicode__(self):
title = _('Image Revsion: %d') % self.revision_number
return str(title)
......
......@@ -2,7 +2,6 @@
from __future__ import unicode_literals
from __future__ import absolute_import
from django.core.urlresolvers import reverse
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.db.models import signals
from django.db import models
......@@ -17,12 +16,11 @@ from wiki.plugins.notifications import settings
from wiki.plugins.notifications.util import get_title
@python_2_unicode_compatible
class ArticleSubscription(ArticlePlugin):
subscription = models.OneToOneField(Subscription)
def __str__(self):
def __unicode__(self):
title = (_("%(user)s subscribing to %(article)s (%(type)s)") %
{'user': self.settings.user.username,
'article': self.article.current_revision.title,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment