Browse Source

Remove python_2_unicode_compatible from codebase

rafalp 6 years ago
parent
commit
5113b317fc

+ 0 - 2
misago/acl/models.py

@@ -1,6 +1,5 @@
 from django.contrib.postgres.fields import JSONField
 from django.contrib.postgres.fields import JSONField
 from django.db import models
 from django.db import models
-from django.utils.encoding import python_2_unicode_compatible
 from django.utils.translation import ugettext as _
 from django.utils.translation import ugettext as _
 
 
 from . import version as acl_version
 from . import version as acl_version
@@ -10,7 +9,6 @@ def permissions_default():
     return {}
     return {}
 
 
 
 
-@python_2_unicode_compatible
 class BaseRole(models.Model):
 class BaseRole(models.Model):
     name = models.CharField(max_length=255)
     name = models.CharField(max_length=255)
     special_role = models.CharField(max_length=255, null=True, blank=True)
     special_role = models.CharField(max_length=255, null=True, blank=True)

+ 0 - 2
misago/categories/models.py

@@ -3,7 +3,6 @@ from mptt.models import MPTTModel, TreeForeignKey
 
 
 from django.db import models
 from django.db import models
 from django.utils import six
 from django.utils import six
-from django.utils.encoding import python_2_unicode_compatible
 
 
 from misago.acl import version as acl_version
 from misago.acl import version as acl_version
 from misago.acl.models import BaseRole
 from misago.acl.models import BaseRole
@@ -58,7 +57,6 @@ class CategoryManager(TreeManager):
         cache.delete(CACHE_NAME)
         cache.delete(CACHE_NAME)
 
 
 
 
-@python_2_unicode_compatible
 class Category(MPTTModel):
 class Category(MPTTModel):
     parent = TreeForeignKey(
     parent = TreeForeignKey(
         'self',
         'self',

+ 0 - 2
misago/threads/models/attachment.py

@@ -10,7 +10,6 @@ from django.db import models
 from django.urls import reverse
 from django.urls import reverse
 from django.utils import timezone
 from django.utils import timezone
 from django.utils.crypto import get_random_string
 from django.utils.crypto import get_random_string
-from django.utils.encoding import python_2_unicode_compatible
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.utils import slugify
 from misago.core.utils import slugify
@@ -30,7 +29,6 @@ def upload_to(instance, filename):
     return os.path.join('attachments', spread_path[:2], spread_path[2:4], secret, filename_clean)
     return os.path.join('attachments', spread_path[:2], spread_path[2:4], secret, filename_clean)
 
 
 
 
-@python_2_unicode_compatible
 class Attachment(models.Model):
 class Attachment(models.Model):
     secret = models.CharField(max_length=64)
     secret = models.CharField(max_length=64)
     filetype = models.ForeignKey('AttachmentType', on_delete=models.CASCADE)
     filetype = models.ForeignKey('AttachmentType', on_delete=models.CASCADE)

+ 0 - 2
misago/threads/models/attachmenttype.py

@@ -1,9 +1,7 @@
 from django.db import models
 from django.db import models
-from django.utils.encoding import python_2_unicode_compatible
 from django.utils.translation import ugettext_lazy as _
 from django.utils.translation import ugettext_lazy as _
 
 
 
 
-@python_2_unicode_compatible
 class AttachmentType(models.Model):
 class AttachmentType(models.Model):
     ENABLED = 0
     ENABLED = 0
     LOCKED = 1
     LOCKED = 1

+ 0 - 2
misago/threads/models/post.py

@@ -5,7 +5,6 @@ from django.contrib.postgres.fields import JSONField
 from django.contrib.postgres.search import SearchVector, SearchVectorField
 from django.contrib.postgres.search import SearchVector, SearchVectorField
 from django.db import models
 from django.db import models
 from django.utils import six, timezone
 from django.utils import six, timezone
-from django.utils.encoding import python_2_unicode_compatible
 
 
 from misago.conf import settings
 from misago.conf import settings
 from misago.core.pgutils import PgPartialIndex
 from misago.core.pgutils import PgPartialIndex
@@ -15,7 +14,6 @@ from misago.threads.checksums import is_post_valid, update_post_checksum
 from misago.threads.filtersearch import filter_search
 from misago.threads.filtersearch import filter_search
 
 
 
 
-@python_2_unicode_compatible
 class Post(models.Model):
 class Post(models.Model):
     category = models.ForeignKey(
     category = models.ForeignKey(
         'misago_categories.Category',
         'misago_categories.Category',

+ 0 - 2
misago/threads/models/thread.py

@@ -1,7 +1,6 @@
 from django.core.exceptions import ObjectDoesNotExist
 from django.core.exceptions import ObjectDoesNotExist
 from django.db import models
 from django.db import models
 from django.utils import timezone
 from django.utils import timezone
-from django.utils.encoding import python_2_unicode_compatible
 from django.utils.translation import ugettext_lazy as _
 from django.utils.translation import ugettext_lazy as _
 
 
 from misago.conf import settings
 from misago.conf import settings
@@ -9,7 +8,6 @@ from misago.core.pgutils import PgPartialIndex
 from misago.core.utils import slugify
 from misago.core.utils import slugify
 
 
 
 
-@python_2_unicode_compatible
 class Thread(models.Model):
 class Thread(models.Model):
     WEIGHT_DEFAULT = 0
     WEIGHT_DEFAULT = 0
     WEIGHT_PINNED = 1
     WEIGHT_PINNED = 1

+ 0 - 4
misago/threads/moderation/exceptions.py

@@ -1,7 +1,3 @@
-from django.utils.encoding import python_2_unicode_compatible
-
-
-@python_2_unicode_compatible
 class ModerationError(Exception):
 class ModerationError(Exception):
     def __init__(self, message):
     def __init__(self, message):
         self.message = message
         self.message = message

+ 0 - 2
misago/users/models/rank.py

@@ -1,6 +1,5 @@
 from django.db import models, transaction
 from django.db import models, transaction
 from django.urls import reverse
 from django.urls import reverse
-from django.utils.encoding import python_2_unicode_compatible
 
 
 from misago.acl import version as acl_version
 from misago.acl import version as acl_version
 from misago.core.utils import slugify
 from misago.core.utils import slugify
@@ -17,7 +16,6 @@ class RankManager(models.Manager):
             rank.save(update_fields=['is_default'])
             rank.save(update_fields=['is_default'])
 
 
 
 
-@python_2_unicode_compatible
 class Rank(models.Model):
 class Rank(models.Model):
     name = models.CharField(max_length=255)
     name = models.CharField(max_length=255)
     slug = models.CharField(unique=True, max_length=255)
     slug = models.CharField(unique=True, max_length=255)