Removed some Py2 compatibility decorators.

- Legacy-Id: 17673
This commit is contained in:
Henrik Levkowetz 2020-04-21 13:54:31 +00:00
parent 493f393217
commit 9aeda11a29
23 changed files with 14 additions and 119 deletions

3
.gitignore vendored
View file

@ -44,10 +44,11 @@
/share /share
/static /static
/testresult /testresult
/tmp
/tmp-nomcom-public-keys-dir
/trunk27 /trunk27
/trunk36 /trunk36
/trunk37 /trunk37
/unix.tag /unix.tag
/tmp-nomcom-public-keys-dir
*.pyc *.pyc
__pycache__ __pycache__

18
env/.gitignore vendored
View file

@ -1,10 +1,12 @@
/bin
/share
/selenium
/etc
/local
/lib
/include
/pip-selfcheck.json
/.Python /.Python
/bin
/etc
/include
/lib
/lib64
/local
/man /man
/pip-selfcheck.json
/pyvenv.cfg
/selenium
/share

View file

@ -6,14 +6,12 @@ from django.contrib.auth.models import User
from django.db import models from django.db import models
from django.db.models import signals from django.db.models import signals
from django.urls import reverse as urlreverse from django.urls import reverse as urlreverse
from django.utils.encoding import python_2_unicode_compatible
from ietf.doc.models import Document, DocEvent, State from ietf.doc.models import Document, DocEvent, State
from ietf.group.models import Group from ietf.group.models import Group
from ietf.person.models import Person, Email from ietf.person.models import Person, Email
from ietf.utils.models import ForeignKey from ietf.utils.models import ForeignKey
@python_2_unicode_compatible
class CommunityList(models.Model): class CommunityList(models.Model):
user = ForeignKey(User, blank=True, null=True) user = ForeignKey(User, blank=True, null=True)
group = ForeignKey(Group, blank=True, null=True) group = ForeignKey(Group, blank=True, null=True)
@ -39,7 +37,6 @@ class CommunityList(models.Model):
return "" return ""
@python_2_unicode_compatible
class SearchRule(models.Model): class SearchRule(models.Model):
# these types define the UI for setting up the rule, and also # these types define the UI for setting up the rule, and also
# helps when interpreting the rule and matching documents # helps when interpreting the rule and matching documents
@ -85,7 +82,6 @@ class SearchRule(models.Model):
def __str__(self): def __str__(self):
return "%s %s %s/%s/%s/%s" % (self.community_list, self.rule_type, self.state, self.group, self.person, self.text) return "%s %s %s/%s/%s/%s" % (self.community_list, self.rule_type, self.state, self.group, self.person, self.text)
@python_2_unicode_compatible
class EmailSubscription(models.Model): class EmailSubscription(models.Model):
community_list = ForeignKey(CommunityList) community_list = ForeignKey(CommunityList)
email = ForeignKey(Email) email = ForeignKey(Email)

View file

@ -5,7 +5,6 @@
from django.db import models from django.db import models
from django.core.exceptions import ValidationError from django.core.exceptions import ValidationError
from django.template import Context from django.template import Context
from django.utils.encoding import python_2_unicode_compatible
from ietf.group.models import Group from ietf.group.models import Group
from ietf.name.models import DBTemplateTypeName from ietf.name.models import DBTemplateTypeName
@ -19,7 +18,6 @@ TEMPLATE_TYPES = (
) )
@python_2_unicode_compatible
class DBTemplate(models.Model): class DBTemplate(models.Model):
path = models.CharField( max_length=255, unique=True, blank=False, null=False, ) path = models.CharField( max_length=255, unique=True, blank=False, null=False, )
title = models.CharField( max_length=255, blank=False, null=False, ) title = models.CharField( max_length=255, blank=False, null=False, )

View file

@ -16,7 +16,7 @@ from django.core.validators import URLValidator, RegexValidator
from django.urls import reverse as urlreverse from django.urls import reverse as urlreverse
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.conf import settings from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible, force_text from django.utils.encoding import force_text
from django.utils.html import mark_safe # type:ignore from django.utils.html import mark_safe # type:ignore
import debug # pyflakes:ignore import debug # pyflakes:ignore
@ -36,7 +36,6 @@ from ietf.utils.models import ForeignKey
logger = logging.getLogger('django') logger = logging.getLogger('django')
@python_2_unicode_compatible
class StateType(models.Model): class StateType(models.Model):
slug = models.CharField(primary_key=True, max_length=30) # draft, draft-iesg, charter, ... slug = models.CharField(primary_key=True, max_length=30) # draft, draft-iesg, charter, ...
label = models.CharField(max_length=255, help_text="Label that should be used (e.g. in admin) for state drop-down for this type of state") # State, IESG state, WG state, ... label = models.CharField(max_length=255, help_text="Label that should be used (e.g. in admin) for state drop-down for this type of state") # State, IESG state, WG state, ...
@ -58,7 +57,6 @@ def check_statetype_slugs(app_configs, **kwargs):
)) ))
return errors return errors
@python_2_unicode_compatible
class State(models.Model): class State(models.Model):
type = ForeignKey(StateType) type = ForeignKey(StateType)
slug = models.SlugField() slug = models.SlugField()
@ -543,7 +541,6 @@ class DocumentInfo(models.Model):
STATUSCHANGE_RELATIONS = ('tops','tois','tohist','toinf','tobcp','toexp') STATUSCHANGE_RELATIONS = ('tops','tois','tohist','toinf','tobcp','toexp')
@python_2_unicode_compatible
class RelatedDocument(models.Model): class RelatedDocument(models.Model):
source = ForeignKey('Document') source = ForeignKey('Document')
target = ForeignKey('DocAlias') target = ForeignKey('DocAlias')
@ -617,7 +614,6 @@ class DocumentAuthorInfo(models.Model):
abstract = True abstract = True
ordering = ["document", "order"] ordering = ["document", "order"]
@python_2_unicode_compatible
class DocumentAuthor(DocumentAuthorInfo): class DocumentAuthor(DocumentAuthorInfo):
document = ForeignKey('Document') document = ForeignKey('Document')
@ -631,7 +627,6 @@ validate_docname = RegexValidator(
'invalid' 'invalid'
) )
@python_2_unicode_compatible
class Document(DocumentInfo): class Document(DocumentInfo):
name = models.CharField(max_length=255, validators=[validate_docname,], unique=True) # immutable name = models.CharField(max_length=255, validators=[validate_docname,], unique=True) # immutable
@ -866,7 +861,6 @@ class DocumentURL(models.Model):
desc = models.CharField(max_length=255, default='', blank=True) desc = models.CharField(max_length=255, default='', blank=True)
url = models.URLField(max_length=2083) # 2083 is the legal max for URLs url = models.URLField(max_length=2083) # 2083 is the legal max for URLs
@python_2_unicode_compatible
class RelatedDocHistory(models.Model): class RelatedDocHistory(models.Model):
source = ForeignKey('DocHistory') source = ForeignKey('DocHistory')
target = ForeignKey('DocAlias', related_name="reversely_related_document_history_set") target = ForeignKey('DocAlias', related_name="reversely_related_document_history_set")
@ -874,7 +868,6 @@ class RelatedDocHistory(models.Model):
def __str__(self): def __str__(self):
return u"%s %s %s" % (self.source.doc.name, self.relationship.name.lower(), self.target.name) return u"%s %s %s" % (self.source.doc.name, self.relationship.name.lower(), self.target.name)
@python_2_unicode_compatible
class DocHistoryAuthor(DocumentAuthorInfo): class DocHistoryAuthor(DocumentAuthorInfo):
# use same naming convention as non-history version to make it a bit # use same naming convention as non-history version to make it a bit
# easier to write generic code # easier to write generic code
@ -883,7 +876,6 @@ class DocHistoryAuthor(DocumentAuthorInfo):
def __str__(self): def __str__(self):
return u"%s %s (%s)" % (self.document.doc.name, self.person, self.order) return u"%s %s (%s)" % (self.document.doc.name, self.person, self.order)
@python_2_unicode_compatible
class DocHistory(DocumentInfo): class DocHistory(DocumentInfo):
doc = ForeignKey(Document, related_name="history_set") doc = ForeignKey(Document, related_name="history_set")
# the name here is used to capture the canonical name at the time # the name here is used to capture the canonical name at the time
@ -934,7 +926,6 @@ class DocHistory(DocumentInfo):
verbose_name = "document history" verbose_name = "document history"
verbose_name_plural = "document histories" verbose_name_plural = "document histories"
@python_2_unicode_compatible
class DocAlias(models.Model): class DocAlias(models.Model):
"""This is used for documents that may appear under multiple names, """This is used for documents that may appear under multiple names,
and in particular for RFCs, which for continuity still keep the and in particular for RFCs, which for continuity still keep the
@ -1042,7 +1033,6 @@ EVENT_TYPES = [
("removed_related_ipr", "Removed related IPR"), ("removed_related_ipr", "Removed related IPR"),
] ]
@python_2_unicode_compatible
class DocEvent(models.Model): class DocEvent(models.Model):
"""An occurrence for a document, used for tracking who, when and what.""" """An occurrence for a document, used for tracking who, when and what."""
time = models.DateTimeField(default=datetime.datetime.now, help_text="When the event happened", db_index=True) time = models.DateTimeField(default=datetime.datetime.now, help_text="When the event happened", db_index=True)
@ -1086,7 +1076,6 @@ class ConsensusDocEvent(DocEvent):
consensus = models.NullBooleanField(default=None) consensus = models.NullBooleanField(default=None)
# IESG events # IESG events
@python_2_unicode_compatible
class BallotType(models.Model): class BallotType(models.Model):
doc_type = ForeignKey(DocTypeName, blank=True, null=True) doc_type = ForeignKey(DocTypeName, blank=True, null=True)
slug = models.SlugField() slug = models.SlugField()
@ -1221,7 +1210,6 @@ class SubmissionDocEvent(DocEvent):
submission = ForeignKey(ietf.submit.models.Submission) submission = ForeignKey(ietf.submit.models.Submission)
# dumping store for removed events # dumping store for removed events
@python_2_unicode_compatible
class DeletedEvent(models.Model): class DeletedEvent(models.Model):
content_type = ForeignKey(ContentType) content_type = ForeignKey(ContentType)
json = models.TextField(help_text="Deleted object in JSON format, with attribute names chosen to be suitable for passing into the relevant create method.") json = models.TextField(help_text="Deleted object in JSON format, with attribute names chosen to be suitable for passing into the relevant create method.")

View file

@ -15,7 +15,6 @@ from django.core.validators import RegexValidator
from django.db import models from django.db import models
from django.db.models.deletion import CASCADE from django.db.models.deletion import CASCADE
from django.dispatch import receiver from django.dispatch import receiver
from django.utils.encoding import python_2_unicode_compatible
from simple_history.models import HistoricalRecords from simple_history.models import HistoricalRecords
@ -29,7 +28,6 @@ from ietf.utils import log
from ietf.utils.models import ForeignKey, OneToOneField from ietf.utils.models import ForeignKey, OneToOneField
@python_2_unicode_compatible
class GroupInfo(models.Model): class GroupInfo(models.Model):
time = models.DateTimeField(default=datetime.datetime.now) time = models.DateTimeField(default=datetime.datetime.now)
name = models.CharField(max_length=80) name = models.CharField(max_length=80)
@ -252,7 +250,6 @@ class GroupHistory(GroupInfo):
class Meta: class Meta:
verbose_name_plural="group histories" verbose_name_plural="group histories"
@python_2_unicode_compatible
class GroupURL(models.Model): class GroupURL(models.Model):
group = ForeignKey(Group) group = ForeignKey(Group)
name = models.CharField(max_length=255) name = models.CharField(max_length=255)
@ -261,7 +258,6 @@ class GroupURL(models.Model):
def __str__(self): def __str__(self):
return u"%s (%s)" % (self.url, self.name) return u"%s (%s)" % (self.url, self.name)
@python_2_unicode_compatible
class GroupMilestoneInfo(models.Model): class GroupMilestoneInfo(models.Model):
group = ForeignKey(Group) group = ForeignKey(Group)
# a group has two sets of milestones, current milestones # a group has two sets of milestones, current milestones
@ -289,7 +285,6 @@ class GroupMilestoneHistory(GroupMilestoneInfo):
time = models.DateTimeField() time = models.DateTimeField()
milestone = ForeignKey(GroupMilestone, related_name="history_set") milestone = ForeignKey(GroupMilestone, related_name="history_set")
@python_2_unicode_compatible
class GroupStateTransitions(models.Model): class GroupStateTransitions(models.Model):
"""Captures that a group has overriden the default available """Captures that a group has overriden the default available
document state transitions for a certain state.""" document state transitions for a certain state."""
@ -310,7 +305,6 @@ GROUP_EVENT_CHOICES = [
("status_update", "Status update"), ("status_update", "Status update"),
] ]
@python_2_unicode_compatible
class GroupEvent(models.Model): class GroupEvent(models.Model):
"""An occurrence for a group, used for tracking who, when and what.""" """An occurrence for a group, used for tracking who, when and what."""
group = ForeignKey(Group) group = ForeignKey(Group)
@ -331,7 +325,6 @@ class ChangeStateGroupEvent(GroupEvent):
class MilestoneGroupEvent(GroupEvent): class MilestoneGroupEvent(GroupEvent):
milestone = ForeignKey(GroupMilestone) milestone = ForeignKey(GroupMilestone)
@python_2_unicode_compatible
class Role(models.Model): class Role(models.Model):
name = ForeignKey(RoleName) name = ForeignKey(RoleName)
group = ForeignKey(Group) group = ForeignKey(Group)
@ -349,7 +342,6 @@ class Role(models.Model):
class Meta: class Meta:
ordering = ['name_id', ] ordering = ['name_id', ]
@python_2_unicode_compatible
class RoleHistory(models.Model): class RoleHistory(models.Model):
# RoleHistory doesn't have a time field as it's not supposed to be # RoleHistory doesn't have a time field as it's not supposed to be
# used on its own - there should always be a GroupHistory # used on its own - there should always be a GroupHistory

View file

@ -37,9 +37,7 @@
import datetime import datetime
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class TelechatAgendaItem(models.Model): class TelechatAgendaItem(models.Model):
TYPE_CHOICES = ( TYPE_CHOICES = (
(1, "Any Other Business (WG News, New Proposals, etc.)"), (1, "Any Other Business (WG News, New Proposals, etc.)"),
@ -80,7 +78,6 @@ class TelechatDateManager(models.Manager):
def active(self): def active(self):
return self.get_queryset().filter(date__gte=datetime.date.today()) return self.get_queryset().filter(date__gte=datetime.date.today())
@python_2_unicode_compatible
class TelechatDate(models.Model): class TelechatDate(models.Model):
objects = TelechatDateManager() objects = TelechatDateManager()

View file

@ -7,7 +7,6 @@ import datetime
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from django.urls import reverse from django.urls import reverse
from django.utils.encoding import python_2_unicode_compatible
from ietf.doc.models import DocAlias, DocEvent from ietf.doc.models import DocAlias, DocEvent
from ietf.name.models import DocRelationshipName,IprDisclosureStateName,IprLicenseTypeName,IprEventTypeName from ietf.name.models import DocRelationshipName,IprDisclosureStateName,IprLicenseTypeName,IprEventTypeName
@ -15,7 +14,6 @@ from ietf.person.models import Person
from ietf.message.models import Message from ietf.message.models import Message
from ietf.utils.models import ForeignKey from ietf.utils.models import ForeignKey
@python_2_unicode_compatible
class IprDisclosureBase(models.Model): class IprDisclosureBase(models.Model):
by = ForeignKey(Person) # who was logged in, or System if nobody was logged in by = ForeignKey(Person) # who was logged in, or System if nobody was logged in
compliant = models.BooleanField("Complies to RFC3979", default=True) compliant = models.BooleanField("Complies to RFC3979", default=True)
@ -158,7 +156,6 @@ class GenericIprDisclosure(IprDisclosureBase):
holder_contact_info = models.TextField(blank=True, help_text="Address, phone, etc.") holder_contact_info = models.TextField(blank=True, help_text="Address, phone, etc.")
statement = models.TextField() # includes licensing info statement = models.TextField() # includes licensing info
@python_2_unicode_compatible
class IprDocRel(models.Model): class IprDocRel(models.Model):
disclosure = ForeignKey(IprDisclosureBase) disclosure = ForeignKey(IprDisclosureBase)
document = ForeignKey(DocAlias) document = ForeignKey(DocAlias)
@ -189,7 +186,6 @@ class IprDocRel(models.Model):
else: else:
return "%s which applies to %s" % (self.disclosure, self.document.name) return "%s which applies to %s" % (self.disclosure, self.document.name)
@python_2_unicode_compatible
class RelatedIpr(models.Model): class RelatedIpr(models.Model):
source = ForeignKey(IprDisclosureBase,related_name='relatedipr_source_set') source = ForeignKey(IprDisclosureBase,related_name='relatedipr_source_set')
target = ForeignKey(IprDisclosureBase,related_name='relatedipr_target_set') target = ForeignKey(IprDisclosureBase,related_name='relatedipr_target_set')
@ -198,7 +194,6 @@ class RelatedIpr(models.Model):
def __str__(self): def __str__(self):
return "%s %s %s" % (self.source.title, self.relationship.name.lower(), self.target.title) return "%s %s %s" % (self.source.title, self.relationship.name.lower(), self.target.title)
@python_2_unicode_compatible
class IprEvent(models.Model): class IprEvent(models.Model):
time = models.DateTimeField(auto_now_add=True) time = models.DateTimeField(auto_now_add=True)
type = ForeignKey(IprEventTypeName) type = ForeignKey(IprEventTypeName)

View file

@ -5,7 +5,6 @@
from django.conf import settings from django.conf import settings
from django.urls import reverse as urlreverse from django.urls import reverse as urlreverse
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify from django.utils.text import slugify
from ietf.person.models import Email, Person from ietf.person.models import Email, Person
@ -27,7 +26,6 @@ STATE_EVENT_MAPPING = {
} }
@python_2_unicode_compatible
class LiaisonStatement(models.Model): class LiaisonStatement(models.Model):
title = models.CharField(max_length=255) title = models.CharField(max_length=255)
from_groups = models.ManyToManyField(Group, blank=True, related_name='liaisonstatement_from_set') from_groups = models.ManyToManyField(Group, blank=True, related_name='liaisonstatement_from_set')
@ -201,7 +199,6 @@ class LiaisonStatement(models.Model):
approval_set.intersection_update(group.liaison_approvers()) approval_set.intersection_update(group.liaison_approvers())
return list(set([ r.email.address for r in approval_set ])) return list(set([ r.email.address for r in approval_set ]))
@python_2_unicode_compatible
class LiaisonStatementAttachment(models.Model): class LiaisonStatementAttachment(models.Model):
statement = ForeignKey(LiaisonStatement) statement = ForeignKey(LiaisonStatement)
document = ForeignKey(Document) document = ForeignKey(Document)
@ -211,7 +208,6 @@ class LiaisonStatementAttachment(models.Model):
return self.document.name return self.document.name
@python_2_unicode_compatible
class RelatedLiaisonStatement(models.Model): class RelatedLiaisonStatement(models.Model):
source = ForeignKey(LiaisonStatement, related_name='source_of_set') source = ForeignKey(LiaisonStatement, related_name='source_of_set')
target = ForeignKey(LiaisonStatement, related_name='target_of_set') target = ForeignKey(LiaisonStatement, related_name='target_of_set')
@ -221,7 +217,6 @@ class RelatedLiaisonStatement(models.Model):
return "%s %s %s" % (self.source.title, self.relationship.name.lower(), self.target.title) return "%s %s %s" % (self.source.title, self.relationship.name.lower(), self.target.title)
@python_2_unicode_compatible
class LiaisonStatementGroupContacts(models.Model): class LiaisonStatementGroupContacts(models.Model):
group = ForeignKey(Group, unique=True, null=True) group = ForeignKey(Group, unique=True, null=True)
contacts = models.CharField(max_length=255,blank=True) contacts = models.CharField(max_length=255,blank=True)
@ -231,7 +226,6 @@ class LiaisonStatementGroupContacts(models.Model):
return "%s" % self.group.name return "%s" % self.group.name
@python_2_unicode_compatible
class LiaisonStatementEvent(models.Model): class LiaisonStatementEvent(models.Model):
time = models.DateTimeField(auto_now_add=True) time = models.DateTimeField(auto_now_add=True)
type = ForeignKey(LiaisonStatementEventTypeName) type = ForeignKey(LiaisonStatementEventTypeName)

View file

@ -5,12 +5,10 @@
from django.conf import settings from django.conf import settings
from django.core.validators import validate_email from django.core.validators import validate_email
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ietf.person.models import Person from ietf.person.models import Person
from ietf.utils.models import ForeignKey from ietf.utils.models import ForeignKey
@python_2_unicode_compatible
class List(models.Model): class List(models.Model):
name = models.CharField(max_length=32) name = models.CharField(max_length=32)
description = models.CharField(max_length=256) description = models.CharField(max_length=256)
@ -21,7 +19,6 @@ class List(models.Model):
def info_url(self): def info_url(self):
return settings.MAILING_LIST_INFO_URL % {'list_addr': self.name } return settings.MAILING_LIST_INFO_URL % {'list_addr': self.name }
@python_2_unicode_compatible
class Subscribed(models.Model): class Subscribed(models.Model):
time = models.DateTimeField(auto_now_add=True) time = models.DateTimeField(auto_now_add=True)
email = models.CharField(max_length=128, validators=[validate_email]) email = models.CharField(max_length=128, validators=[validate_email])
@ -31,7 +28,6 @@ class Subscribed(models.Model):
class Meta: class Meta:
verbose_name_plural = "Subscribed" verbose_name_plural = "Subscribed"
@python_2_unicode_compatible
class Whitelisted(models.Model): class Whitelisted(models.Model):
time = models.DateTimeField(auto_now_add=True) time = models.DateTimeField(auto_now_add=True)
email = models.CharField("Email address", max_length=64, validators=[validate_email]) email = models.CharField("Email address", max_length=64, validators=[validate_email])

View file

@ -4,7 +4,6 @@
from django.db import models from django.db import models
from django.template import Template, Context from django.template import Template, Context
from django.utils.encoding import python_2_unicode_compatible
from email.utils import parseaddr from email.utils import parseaddr
from ietf.utils.mail import formataddr, get_email_addresses_from_text from ietf.utils.mail import formataddr, get_email_addresses_from_text
@ -31,7 +30,6 @@ def clean_duplicates(addrlist):
addresses.append(addr) addresses.append(addr)
return addresses return addresses
@python_2_unicode_compatible
class MailTrigger(models.Model): class MailTrigger(models.Model):
slug = models.CharField(max_length=64, primary_key=True) slug = models.CharField(max_length=64, primary_key=True)
desc = models.TextField(blank=True) desc = models.TextField(blank=True)
@ -44,7 +42,6 @@ class MailTrigger(models.Model):
def __str__(self): def __str__(self):
return self.slug return self.slug
@python_2_unicode_compatible
class Recipient(models.Model): class Recipient(models.Model):
slug = models.CharField(max_length=32, primary_key=True) slug = models.CharField(max_length=32, primary_key=True)
desc = models.TextField(blank=True) desc = models.TextField(blank=True)

View file

@ -22,7 +22,6 @@ from django.conf import settings
# mostly used by json_dict() # mostly used by json_dict()
#from django.template.defaultfilters import slugify, date as date_format, time as time_format #from django.template.defaultfilters import slugify, date as date_format, time as time_format
from django.template.defaultfilters import date as date_format from django.template.defaultfilters import date as date_format
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify from django.utils.text import slugify
from ietf.dbtemplate.models import DBTemplate from ietf.dbtemplate.models import DBTemplate
@ -58,7 +57,6 @@ def fmt_date(o):
d = datetime_safe.new_date(o) d = datetime_safe.new_date(o)
return d.strftime(DATE_FORMAT) return d.strftime(DATE_FORMAT)
@python_2_unicode_compatible
class Meeting(models.Model): class Meeting(models.Model):
# number is either the number for IETF meetings, or some other # number is either the number for IETF meetings, or some other
# identifier for interim meetings/IESG retreats/liaison summits/... # identifier for interim meetings/IESG retreats/liaison summits/...
@ -308,7 +306,6 @@ class Meeting(models.Model):
# === Rooms, Resources, Floorplans ============================================= # === Rooms, Resources, Floorplans =============================================
@python_2_unicode_compatible
class ResourceAssociation(models.Model): class ResourceAssociation(models.Model):
name = ForeignKey(RoomResourceName) name = ForeignKey(RoomResourceName)
icon = models.CharField(max_length=64) # icon to be found in /static/img icon = models.CharField(max_length=64) # icon to be found in /static/img
@ -325,7 +322,6 @@ class ResourceAssociation(models.Model):
res1['resource_id'] = self.pk res1['resource_id'] = self.pk
return res1 return res1
@python_2_unicode_compatible
class Room(models.Model): class Room(models.Model):
meeting = ForeignKey(Meeting) meeting = ForeignKey(Meeting)
modified = models.DateTimeField(auto_now=True) modified = models.DateTimeField(auto_now=True)
@ -418,7 +414,6 @@ def floorplan_path(instance, filename):
root, ext = os.path.splitext(filename) root, ext = os.path.splitext(filename)
return "%s/floorplan-%s-%s%s" % (settings.FLOORPLAN_MEDIA_DIR, instance.meeting.number, xslugify(instance.name), ext) return "%s/floorplan-%s-%s%s" % (settings.FLOORPLAN_MEDIA_DIR, instance.meeting.number, xslugify(instance.name), ext)
@python_2_unicode_compatible
class FloorPlan(models.Model): class FloorPlan(models.Model):
name = models.CharField(max_length=255) name = models.CharField(max_length=255)
short = models.CharField(max_length=3, default='') short = models.CharField(max_length=3, default='')
@ -435,7 +430,6 @@ class FloorPlan(models.Model):
# === Schedules, Sessions, Timeslots and Assignments =========================== # === Schedules, Sessions, Timeslots and Assignments ===========================
@python_2_unicode_compatible
class TimeSlot(models.Model): class TimeSlot(models.Model):
""" """
Everything that would appear on the meeting agenda of a meeting is Everything that would appear on the meeting agenda of a meeting is
@ -603,7 +597,6 @@ class TimeSlot(models.Model):
# end of TimeSlot # end of TimeSlot
@python_2_unicode_compatible
class Schedule(models.Model): class Schedule(models.Model):
""" """
Each person may have multiple schedules saved. Each person may have multiple schedules saved.
@ -707,7 +700,6 @@ class Schedule(models.Model):
self.delete() self.delete()
# to be renamed SchedTimeSessAssignments (stsa) # to be renamed SchedTimeSessAssignments (stsa)
@python_2_unicode_compatible
class SchedTimeSessAssignment(models.Model): class SchedTimeSessAssignment(models.Model):
""" """
This model provides an N:M relationship between Session and TimeSlot. This model provides an N:M relationship between Session and TimeSlot.
@ -812,7 +804,6 @@ class SchedTimeSessAssignment(models.Model):
return "-".join(components).lower() return "-".join(components).lower()
@python_2_unicode_compatible
class Constraint(models.Model): class Constraint(models.Model):
""" """
Specifies a constraint on the scheduling. Specifies a constraint on the scheduling.
@ -883,7 +874,6 @@ class Constraint(models.Model):
return ct1 return ct1
@python_2_unicode_compatible
class SessionPresentation(models.Model): class SessionPresentation(models.Model):
session = ForeignKey('Session') session = ForeignKey('Session')
document = ForeignKey(Document) document = ForeignKey(Document)
@ -901,7 +891,6 @@ class SessionPresentation(models.Model):
constraint_cache_uses = 0 constraint_cache_uses = 0
constraint_cache_initials = 0 constraint_cache_initials = 0
@python_2_unicode_compatible
class Session(models.Model): class Session(models.Model):
"""Session records that a group should have a session on the """Session records that a group should have a session on the
meeting (time and location is stored in a TimeSlot) - if multiple meeting (time and location is stored in a TimeSlot) - if multiple
@ -1215,7 +1204,6 @@ class Session(models.Model):
else: else:
return self.group.acronym return self.group.acronym
@python_2_unicode_compatible
class SchedulingEvent(models.Model): class SchedulingEvent(models.Model):
session = ForeignKey(Session) session = ForeignKey(Session)
time = models.DateTimeField(default=datetime.datetime.now, help_text="When the event happened") time = models.DateTimeField(default=datetime.datetime.now, help_text="When the event happened")
@ -1225,7 +1213,6 @@ class SchedulingEvent(models.Model):
def __str__(self): def __str__(self):
return u'%s : %s : %s : %s' % (self.session, self.status, self.time, self.by) return u'%s : %s : %s : %s' % (self.session, self.status, self.time, self.by)
@python_2_unicode_compatible
class ImportantDate(models.Model): class ImportantDate(models.Model):
meeting = ForeignKey(Meeting) meeting = ForeignKey(Meeting)
date = models.DateField() date = models.DateField()

View file

@ -6,7 +6,6 @@ import datetime
import email.utils import email.utils
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
import debug # pyflakes:ignore import debug # pyflakes:ignore
@ -17,7 +16,6 @@ from ietf.name.models import RoleName
from ietf.utils.models import ForeignKey from ietf.utils.models import ForeignKey
from ietf.utils.mail import get_email_addresses_from_text from ietf.utils.mail import get_email_addresses_from_text
@python_2_unicode_compatible
class Message(models.Model): class Message(models.Model):
time = models.DateTimeField(default=datetime.datetime.now) time = models.DateTimeField(default=datetime.datetime.now)
by = ForeignKey(Person) by = ForeignKey(Person)
@ -48,7 +46,6 @@ class Message(models.Model):
return r if isinstance(r, list) else get_email_addresses_from_text(r) return r if isinstance(r, list) else get_email_addresses_from_text(r)
@python_2_unicode_compatible
class MessageAttachment(models.Model): class MessageAttachment(models.Model):
message = ForeignKey(Message) message = ForeignKey(Message)
filename = models.CharField(max_length=255, db_index=True, blank=True) filename = models.CharField(max_length=255, db_index=True, blank=True)
@ -61,7 +58,6 @@ class MessageAttachment(models.Model):
return self.filename return self.filename
@python_2_unicode_compatible
class SendQueue(models.Model): class SendQueue(models.Model):
time = models.DateTimeField(default=datetime.datetime.now) time = models.DateTimeField(default=datetime.datetime.now)
by = ForeignKey(Person) by = ForeignKey(Person)
@ -80,7 +76,6 @@ class SendQueue(models.Model):
return "'%s' %s -> %s (sent at %s)" % (self.message.subject, self.message.frm, self.message.to, self.sent_at or "<not yet>") return "'%s' %s -> %s (sent at %s)" % (self.message.subject, self.message.frm, self.message.to, self.sent_at or "<not yet>")
@python_2_unicode_compatible
class AnnouncementFrom(models.Model): class AnnouncementFrom(models.Model):
name = ForeignKey(RoleName) name = ForeignKey(RoleName)
group = ForeignKey(Group) group = ForeignKey(Group)

View file

@ -3,11 +3,9 @@
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ietf.utils.models import ForeignKey from ietf.utils.models import ForeignKey
@python_2_unicode_compatible
class NameModel(models.Model): class NameModel(models.Model):
slug = models.CharField(max_length=32, primary_key=True) slug = models.CharField(max_length=32, primary_key=True)
name = models.CharField(max_length=255) name = models.CharField(max_length=255)

View file

@ -10,7 +10,6 @@ from django.conf import settings
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.template.defaultfilters import linebreaks # type: ignore from django.template.defaultfilters import linebreaks # type: ignore
from django.utils.encoding import python_2_unicode_compatible
import debug # pyflakes:ignore import debug # pyflakes:ignore
@ -43,7 +42,6 @@ class ReminderDates(models.Model):
nomcom = ForeignKey('NomCom') nomcom = ForeignKey('NomCom')
@python_2_unicode_compatible
class NomCom(models.Model): class NomCom(models.Model):
public_key = models.FileField(storage=NoLocationMigrationFileSystemStorage(location=settings.NOMCOM_PUBLIC_KEYS_DIR), public_key = models.FileField(storage=NoLocationMigrationFileSystemStorage(location=settings.NOMCOM_PUBLIC_KEYS_DIR),
upload_to=upload_path_handler, blank=True, null=True) upload_to=upload_path_handler, blank=True, null=True)
@ -110,7 +108,6 @@ def delete_nomcom(sender, **kwargs):
post_delete.connect(delete_nomcom, sender=NomCom) post_delete.connect(delete_nomcom, sender=NomCom)
@python_2_unicode_compatible
class Nomination(models.Model): class Nomination(models.Model):
position = ForeignKey('Position') position = ForeignKey('Position')
candidate_name = models.CharField(verbose_name='Candidate name', max_length=255) candidate_name = models.CharField(verbose_name='Candidate name', max_length=255)
@ -135,7 +132,6 @@ class Nomination(models.Model):
return "%s (%s)" % (self.candidate_name, self.candidate_email) return "%s (%s)" % (self.candidate_name, self.candidate_email)
@python_2_unicode_compatible
class Nominee(models.Model): class Nominee(models.Model):
email = ForeignKey(Email) email = ForeignKey(Email)
@ -163,7 +159,6 @@ class Nominee(models.Model):
else: else:
return self.email.address return self.email.address
@python_2_unicode_compatible
class NomineePosition(models.Model): class NomineePosition(models.Model):
position = ForeignKey('Position') position = ForeignKey('Position')
@ -193,7 +188,6 @@ class NomineePosition(models.Model):
nominees__in=[self.nominee]) nominees__in=[self.nominee])
@python_2_unicode_compatible
class Position(models.Model): class Position(models.Model):
nomcom = ForeignKey('NomCom') nomcom = ForeignKey('NomCom')
name = models.CharField(verbose_name='Name', max_length=255, help_text='This short description will appear on the Nomination and Feedback pages. Be as descriptive as necessary. Past examples: "Transport AD", "IAB Member"') name = models.CharField(verbose_name='Name', max_length=255, help_text='This short description will appear on the Nomination and Feedback pages. Be as descriptive as necessary. Past examples: "Transport AD", "IAB Member"')
@ -254,7 +248,6 @@ class Position(models.Model):
else: else:
return specific_reqs return specific_reqs
@python_2_unicode_compatible
class Topic(models.Model): class Topic(models.Model):
nomcom = ForeignKey('NomCom') nomcom = ForeignKey('NomCom')
subject = models.CharField(verbose_name='Name', max_length=255, help_text='This short description will appear on the Feedback pages.') subject = models.CharField(verbose_name='Name', max_length=255, help_text='This short description will appear on the Feedback pages.')
@ -284,7 +277,6 @@ class Topic(models.Model):
rendered = linebreaks(rendered) rendered = linebreaks(rendered)
return rendered return rendered
@python_2_unicode_compatible
class Feedback(models.Model): class Feedback(models.Model):
nomcom = ForeignKey('NomCom') nomcom = ForeignKey('NomCom')
author = models.EmailField(verbose_name='Author', blank=True) author = models.EmailField(verbose_name='Author', blank=True)

View file

@ -17,7 +17,7 @@ from django.core.validators import validate_email
from django.db import models from django.db import models
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.urls import reverse as urlreverse from django.urls import reverse as urlreverse
from django.utils.encoding import python_2_unicode_compatible, smart_bytes from django.utils.encoding import smart_bytes
from django.utils.text import slugify from django.utils.text import slugify
from simple_history.models import HistoricalRecords from simple_history.models import HistoricalRecords
@ -33,7 +33,6 @@ from ietf.utils import log
from ietf.utils.models import ForeignKey, OneToOneField from ietf.utils.models import ForeignKey, OneToOneField
@python_2_unicode_compatible
class Person(models.Model): class Person(models.Model):
history = HistoricalRecords() history = HistoricalRecords()
user = OneToOneField(User, blank=True, null=True, on_delete=models.SET_NULL) user = OneToOneField(User, blank=True, null=True, on_delete=models.SET_NULL)
@ -239,7 +238,6 @@ class Person(models.Model):
return [ (v, n) for (v, n, r) in PERSON_API_KEY_VALUES if r==None or has_role(self.user, r) ] return [ (v, n) for (v, n, r) in PERSON_API_KEY_VALUES if r==None or has_role(self.user, r) ]
@python_2_unicode_compatible
class Alias(models.Model): class Alias(models.Model):
"""This is used for alternative forms of a name. This is the """This is used for alternative forms of a name. This is the
primary lookup point for names, and should always contain the primary lookup point for names, and should always contain the
@ -267,7 +265,6 @@ class Alias(models.Model):
class Meta: class Meta:
verbose_name_plural = "Aliases" verbose_name_plural = "Aliases"
@python_2_unicode_compatible
class Email(models.Model): class Email(models.Model):
history = HistoricalRecords() history = HistoricalRecords()
address = models.CharField(max_length=64, primary_key=True, validators=[validate_email]) address = models.CharField(max_length=64, primary_key=True, validators=[validate_email])
@ -341,7 +338,6 @@ PERSON_API_KEY_VALUES = [
] ]
PERSON_API_KEY_ENDPOINTS = [ (v, n) for (v, n, r) in PERSON_API_KEY_VALUES ] PERSON_API_KEY_ENDPOINTS = [ (v, n) for (v, n, r) in PERSON_API_KEY_VALUES ]
@python_2_unicode_compatible
class PersonalApiKey(models.Model): class PersonalApiKey(models.Model):
person = ForeignKey(Person, related_name='apikeys') person = ForeignKey(Person, related_name='apikeys')
endpoint = models.CharField(max_length=128, null=False, blank=False, choices=PERSON_API_KEY_ENDPOINTS) endpoint = models.CharField(max_length=128, null=False, blank=False, choices=PERSON_API_KEY_ENDPOINTS)
@ -388,7 +384,6 @@ PERSON_EVENT_CHOICES = [
("email_address_deactivated", "Email address deactivated"), ("email_address_deactivated", "Email address deactivated"),
] ]
@python_2_unicode_compatible
class PersonEvent(models.Model): class PersonEvent(models.Model):
person = ForeignKey(Person) person = ForeignKey(Person)
time = models.DateTimeField(default=datetime.datetime.now, help_text="When the event happened") time = models.DateTimeField(default=datetime.datetime.now, help_text="When the event happened")

View file

@ -3,11 +3,9 @@
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ietf.utils.models import ForeignKey from ietf.utils.models import ForeignKey
@python_2_unicode_compatible
class Redirect(models.Model): class Redirect(models.Model):
"""Mapping of CGI script to url. The "rest" is a """Mapping of CGI script to url. The "rest" is a
sprintf-style string with %(param)s entries to insert sprintf-style string with %(param)s entries to insert
@ -28,7 +26,6 @@ class Redirect(models.Model):
def __str__(self): def __str__(self):
return "%s -> %s/%s" % (self.cgi, self.url, self.rest) return "%s -> %s/%s" % (self.cgi, self.url, self.rest)
@python_2_unicode_compatible
class Suffix(models.Model): class Suffix(models.Model):
"""This is a "rest" and "remove" (see Redirect class) """This is a "rest" and "remove" (see Redirect class)
for requests with command=. for requests with command=.
@ -40,7 +37,6 @@ class Suffix(models.Model):
class Meta: class Meta:
verbose_name_plural="Suffixes" verbose_name_plural="Suffixes"
@python_2_unicode_compatible
class Command(models.Model): class Command(models.Model):
"""When a request comes in with a command= argument, """When a request comes in with a command= argument,
the command is looked up in this table to see if there the command is looked up in this table to see if there

View file

@ -7,7 +7,6 @@ import datetime
from simple_history.models import HistoricalRecords from simple_history.models import HistoricalRecords
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ietf.doc.models import Document from ietf.doc.models import Document
from ietf.group.models import Group from ietf.group.models import Group
@ -17,7 +16,6 @@ from ietf.name.models import ReviewTypeName, ReviewRequestStateName, ReviewResul
from ietf.utils.validators import validate_regular_expression_string from ietf.utils.validators import validate_regular_expression_string
from ietf.utils.models import ForeignKey, OneToOneField from ietf.utils.models import ForeignKey, OneToOneField
@python_2_unicode_compatible
class ReviewerSettings(models.Model): class ReviewerSettings(models.Model):
"""Keeps track of admin data associated with a reviewer in a team.""" """Keeps track of admin data associated with a reviewer in a team."""
history = HistoricalRecords(history_change_reason_field=models.TextField(null=True)) history = HistoricalRecords(history_change_reason_field=models.TextField(null=True))
@ -46,7 +44,6 @@ class ReviewerSettings(models.Model):
class Meta: class Meta:
verbose_name_plural = "reviewer settings" verbose_name_plural = "reviewer settings"
@python_2_unicode_compatible
class ReviewSecretarySettings(models.Model): class ReviewSecretarySettings(models.Model):
"""Keeps track of admin data associated with a secretary in a team.""" """Keeps track of admin data associated with a secretary in a team."""
team = ForeignKey(Group, limit_choices_to=~models.Q(reviewteamsettings=None)) team = ForeignKey(Group, limit_choices_to=~models.Q(reviewteamsettings=None))
@ -61,7 +58,6 @@ class ReviewSecretarySettings(models.Model):
class Meta: class Meta:
verbose_name_plural = "review secretary settings" verbose_name_plural = "review secretary settings"
@python_2_unicode_compatible
class UnavailablePeriod(models.Model): class UnavailablePeriod(models.Model):
history = HistoricalRecords(history_change_reason_field=models.TextField(null=True)) history = HistoricalRecords(history_change_reason_field=models.TextField(null=True))
team = ForeignKey(Group, limit_choices_to=~models.Q(reviewteamsettings=None)) team = ForeignKey(Group, limit_choices_to=~models.Q(reviewteamsettings=None))
@ -93,7 +89,6 @@ class UnavailablePeriod(models.Model):
def __str__(self): def __str__(self):
return "{} is unavailable in {} {} - {}".format(self.person, self.team.acronym, self.start_date or "", self.end_date or "") return "{} is unavailable in {} {} - {}".format(self.person, self.team.acronym, self.start_date or "", self.end_date or "")
@python_2_unicode_compatible
class ReviewWish(models.Model): class ReviewWish(models.Model):
"""Reviewer wishes to review a document when it becomes available for review.""" """Reviewer wishes to review a document when it becomes available for review."""
time = models.DateTimeField(default=datetime.datetime.now) time = models.DateTimeField(default=datetime.datetime.now)
@ -108,7 +103,6 @@ class ReviewWish(models.Model):
verbose_name_plural = "review wishes" verbose_name_plural = "review wishes"
@python_2_unicode_compatible
class NextReviewerInTeam(models.Model): class NextReviewerInTeam(models.Model):
team = ForeignKey(Group, limit_choices_to=~models.Q(reviewteamsettings=None)) team = ForeignKey(Group, limit_choices_to=~models.Q(reviewteamsettings=None))
next_reviewer = ForeignKey(Person) next_reviewer = ForeignKey(Person)
@ -120,7 +114,6 @@ class NextReviewerInTeam(models.Model):
verbose_name = "next reviewer in team setting" verbose_name = "next reviewer in team setting"
verbose_name_plural = "next reviewer in team settings" verbose_name_plural = "next reviewer in team settings"
@python_2_unicode_compatible
class ReviewRequest(models.Model): class ReviewRequest(models.Model):
"""Represents a request for a review and the process it goes through.""" """Represents a request for a review and the process it goes through."""
history = HistoricalRecords(history_change_reason_field=models.TextField(null=True)) history = HistoricalRecords(history_change_reason_field=models.TextField(null=True))
@ -146,7 +139,6 @@ class ReviewRequest(models.Model):
def request_closed_time(self): def request_closed_time(self):
return self.doc.request_closed_time(self) or self.time return self.doc.request_closed_time(self) or self.time
@python_2_unicode_compatible
class ReviewAssignment(models.Model): class ReviewAssignment(models.Model):
""" One of possibly many reviews assigned in response to a ReviewRequest """ """ One of possibly many reviews assigned in response to a ReviewRequest """
history = HistoricalRecords(history_change_reason_field=models.TextField(null=True)) history = HistoricalRecords(history_change_reason_field=models.TextField(null=True))
@ -183,7 +175,6 @@ def get_default_review_types():
def get_default_review_results(): def get_default_review_results():
return ReviewResultName.objects.filter(slug__in=['not-ready', 'right-track', 'almost-ready', 'ready-issues', 'ready-nits', 'ready']) return ReviewResultName.objects.filter(slug__in=['not-ready', 'right-track', 'almost-ready', 'ready-issues', 'ready-nits', 'ready'])
@python_2_unicode_compatible
class ReviewTeamSettings(models.Model): class ReviewTeamSettings(models.Model):
"""Holds configuration specific to groups that are review teams""" """Holds configuration specific to groups that are review teams"""
group = OneToOneField(Group) group = OneToOneField(Group)

View file

@ -6,7 +6,6 @@ import os
from django.conf import settings from django.conf import settings
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from ietf.meeting.models import Meeting from ietf.meeting.models import Meeting
@ -61,7 +60,6 @@ class InterimMeeting(Meeting):
else: else:
return '' return ''
@python_2_unicode_compatible
class Registration(models.Model): class Registration(models.Model):
rsn = models.AutoField(primary_key=True) rsn = models.AutoField(primary_key=True)
fname = models.CharField(max_length=255) fname = models.CharField(max_length=255)

View file

@ -3,7 +3,6 @@
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
import debug # pyflakes:ignore import debug # pyflakes:ignore
@ -13,7 +12,6 @@ from ietf.person.models import Person
from ietf.utils.models import ForeignKey from ietf.utils.models import ForeignKey
@python_2_unicode_compatible
class AffiliationAlias(models.Model): class AffiliationAlias(models.Model):
"""Records that alias should be treated as name for statistical """Records that alias should be treated as name for statistical
purposes.""" purposes."""
@ -31,7 +29,6 @@ class AffiliationAlias(models.Model):
class Meta: class Meta:
verbose_name_plural = "affiliation aliases" verbose_name_plural = "affiliation aliases"
@python_2_unicode_compatible
class AffiliationIgnoredEnding(models.Model): class AffiliationIgnoredEnding(models.Model):
"""Records that ending should be stripped from the affiliation for statistical purposes.""" """Records that ending should be stripped from the affiliation for statistical purposes."""
@ -40,7 +37,6 @@ class AffiliationIgnoredEnding(models.Model):
def __str__(self): def __str__(self):
return self.ending return self.ending
@python_2_unicode_compatible
class CountryAlias(models.Model): class CountryAlias(models.Model):
"""Records that alias should be treated as country for statistical """Records that alias should be treated as country for statistical
purposes.""" purposes."""
@ -54,7 +50,6 @@ class CountryAlias(models.Model):
class Meta: class Meta:
verbose_name_plural = "country aliases" verbose_name_plural = "country aliases"
@python_2_unicode_compatible
class MeetingRegistration(models.Model): class MeetingRegistration(models.Model):
"""Registration attendee records from the IETF registration system""" """Registration attendee records from the IETF registration system"""
meeting = ForeignKey(Meeting) meeting = ForeignKey(Meeting)

View file

@ -7,7 +7,6 @@ import email
import jsonfield import jsonfield
from django.db import models from django.db import models
from django.utils.encoding import python_2_unicode_compatible
import debug # pyflakes:ignore import debug # pyflakes:ignore
@ -28,7 +27,6 @@ def parse_email_line(line):
name, addr = email.utils.parseaddr(line) if '@' in line else (line, '') name, addr = email.utils.parseaddr(line) if '@' in line else (line, '')
return dict(name=name, email=addr) return dict(name=name, email=addr)
@python_2_unicode_compatible
class Submission(models.Model): class Submission(models.Model):
state = ForeignKey(DraftSubmissionStateName) state = ForeignKey(DraftSubmissionStateName)
remote_ip = models.CharField(max_length=100, blank=True) remote_ip = models.CharField(max_length=100, blank=True)
@ -76,7 +74,6 @@ class Submission(models.Model):
checks = [ self.checks.filter(checker=c).latest('time') for c in self.checks.values_list('checker', flat=True).distinct() ] checks = [ self.checks.filter(checker=c).latest('time') for c in self.checks.values_list('checker', flat=True).distinct() ]
return checks return checks
@python_2_unicode_compatible
class SubmissionCheck(models.Model): class SubmissionCheck(models.Model):
time = models.DateTimeField(default=datetime.datetime.now) time = models.DateTimeField(default=datetime.datetime.now)
submission = ForeignKey(Submission, related_name='checks') submission = ForeignKey(Submission, related_name='checks')
@ -95,7 +92,6 @@ class SubmissionCheck(models.Model):
def has_errors(self): def has_errors(self):
return self.errors != '[]' return self.errors != '[]'
@python_2_unicode_compatible
class SubmissionEvent(models.Model): class SubmissionEvent(models.Model):
submission = ForeignKey(Submission) submission = ForeignKey(Submission)
time = models.DateTimeField(default=datetime.datetime.now) time = models.DateTimeField(default=datetime.datetime.now)
@ -109,7 +105,6 @@ class SubmissionEvent(models.Model):
ordering = ("-time", "-id") ordering = ("-time", "-id")
@python_2_unicode_compatible
class Preapproval(models.Model): class Preapproval(models.Model):
"""Pre-approved draft submission name.""" """Pre-approved draft submission name."""
name = models.CharField(max_length=255, db_index=True) name = models.CharField(max_length=255, db_index=True)
@ -119,7 +114,6 @@ class Preapproval(models.Model):
def __str__(self): def __str__(self):
return self.name return self.name
@python_2_unicode_compatible
class SubmissionEmailEvent(SubmissionEvent): class SubmissionEmailEvent(SubmissionEvent):
message = ForeignKey(Message, null=True, blank=True,related_name='manualevents') message = ForeignKey(Message, null=True, blank=True,related_name='manualevents')
msgtype = models.CharField(max_length=25) msgtype = models.CharField(max_length=25)

View file

@ -47,7 +47,6 @@ from bs4 import BeautifulSoup
import django.test import django.test
from django.conf import settings from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.utils.text import slugify from django.utils.text import slugify
import debug # pyflakes:ignore import debug # pyflakes:ignore
@ -98,7 +97,6 @@ class ReverseLazyTest(django.test.TestCase):
response = self.client.get('/ipr/update/') response = self.client.get('/ipr/update/')
self.assertRedirects(response, "/ipr/", status_code=301) self.assertRedirects(response, "/ipr/", status_code=301)
@python_2_unicode_compatible
class TestCase(django.test.TestCase): class TestCase(django.test.TestCase):
""" """
Does basically the same as django.test.TestCase, but adds asserts for html5 validation. Does basically the same as django.test.TestCase, but adds asserts for html5 validation.

Binary file not shown.