django 3.2: stop using @python_2_unicode_compatible (#64430)

This commit is contained in:
Emmanuel Cazenave 2022-06-09 15:48:37 +02:00
parent 7209ea81a1
commit 8fdd44a639
1 changed files with 1 additions and 14 deletions

View File

@ -34,7 +34,7 @@ from picklefield.fields import PickledObjectField
from django.utils.html import strip_tags
from django.utils.timezone import now, utc
from django.forms import ValidationError
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.encoding import force_text
from django.utils.six.moves.urllib import parse as urlparse
from django.utils.safestring import mark_safe
@ -82,7 +82,6 @@ class NameNaturalKey(object):
return (self.name,)
@python_2_unicode_compatible
class FileType(NameNaturalKey, Model):
"""
A type of file that can be sent inside the application.
@ -108,7 +107,6 @@ class FileTypeAttachedFileKindManager(Manager):
return self.get(name=name, file_type__name=file_type_name)
@python_2_unicode_compatible
class FileTypeAttachedFileKind(Model):
MIME_TYPES_RE = re.compile(
r'^\s*(?:(?:text|image|audio|application|video)'
@ -159,7 +157,6 @@ class FileTypeAttachedFileKind(Model):
return self.name
@python_2_unicode_compatible
class Content(Model):
'''Predefined content type'''
@ -218,7 +215,6 @@ class DocumentManager(Manager):
)
@python_2_unicode_compatible
class Document(Model):
"""
Represent a file sent between a user and some targets, user or groups.
@ -472,7 +468,6 @@ class DeletedDocument(Model):
ordering = ('-document',)
@python_2_unicode_compatible
class DocumentForwarded(Model):
"""Model to store tags applied to models.
@ -506,7 +501,6 @@ def list_to_csv(l, mapping_func=None):
return u', '.join(map(force_text, l))
@python_2_unicode_compatible
class AutomaticForwarding(Model):
"""
Choice of sender and filetype to transfer mail automatically to a list
@ -583,7 +577,6 @@ class AutomaticForwarding(Model):
)
@python_2_unicode_compatible
class AttachedFile(Model):
'''Uploaded file attached to a Document'''
@ -636,7 +629,6 @@ def is_guest(user):
return False
@python_2_unicode_compatible
class Delegation(Model):
"""
Delegate account, managable by user themselves.
@ -690,7 +682,6 @@ class MailingListManager(GetByNameManager):
return lists
@python_2_unicode_compatible
class MailingList(NameNaturalKey, Model):
'''A list of recipients.'''
@ -742,7 +733,6 @@ class MailingList(NameNaturalKey, Model):
return self.name
@python_2_unicode_compatible
class Mailbox(Model):
'''List of document received by a user'''
@ -790,7 +780,6 @@ class Outbox(Mailbox):
verbose_name_plural = _('Outboxes')
@python_2_unicode_compatible
class SendingLimitation(Model):
mailing_list = OneToOneField(
MailingList, unique=True, on_delete=CASCADE, verbose_name=MailingList._meta.verbose_name
@ -821,7 +810,6 @@ class SendingLimitation(Model):
)
@python_2_unicode_compatible
class DocbowProfile(Model):
'''Hold extra user attributes'''
@ -866,7 +854,6 @@ class NotificationManager(Manager):
self.bulk_create(notifications)
@python_2_unicode_compatible
class Notification(Model):
"""Asynchronous notification