Skip to content

Commit 9aeda11

Browse files
committed
Removed some Py2 compatibility decorators.
- Legacy-Id: 17673
1 parent 493f393 commit 9aeda11

23 files changed

Lines changed: 12 additions & 117 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@
4444
/share
4545
/static
4646
/testresult
47+
/tmp
48+
/tmp-nomcom-public-keys-dir
4749
/trunk27
4850
/trunk36
4951
/trunk37
5052
/unix.tag
51-
/tmp-nomcom-public-keys-dir
5253
*.pyc
5354
__pycache__

env/.gitignore

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
/.Python
12
/bin
2-
/share
3-
/selenium
43
/etc
5-
/local
6-
/lib
74
/include
8-
/pip-selfcheck.json
9-
/.Python
5+
/lib
6+
/lib64
7+
/local
108
/man
9+
/pip-selfcheck.json
10+
/pyvenv.cfg
11+
/selenium
12+
/share

ietf/community/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
from django.db import models
77
from django.db.models import signals
88
from django.urls import reverse as urlreverse
9-
from django.utils.encoding import python_2_unicode_compatible
109

1110
from ietf.doc.models import Document, DocEvent, State
1211
from ietf.group.models import Group
1312
from ietf.person.models import Person, Email
1413
from ietf.utils.models import ForeignKey
1514

16-
@python_2_unicode_compatible
1715
class CommunityList(models.Model):
1816
user = ForeignKey(User, blank=True, null=True)
1917
group = ForeignKey(Group, blank=True, null=True)
@@ -39,7 +37,6 @@ def get_absolute_url(self):
3937
return ""
4038

4139

42-
@python_2_unicode_compatible
4340
class SearchRule(models.Model):
4441
# these types define the UI for setting up the rule, and also
4542
# helps when interpreting the rule and matching documents
@@ -85,7 +82,6 @@ class SearchRule(models.Model):
8582
def __str__(self):
8683
return "%s %s %s/%s/%s/%s" % (self.community_list, self.rule_type, self.state, self.group, self.person, self.text)
8784

88-
@python_2_unicode_compatible
8985
class EmailSubscription(models.Model):
9086
community_list = ForeignKey(CommunityList)
9187
email = ForeignKey(Email)

ietf/dbtemplate/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from django.db import models
66
from django.core.exceptions import ValidationError
77
from django.template import Context
8-
from django.utils.encoding import python_2_unicode_compatible
98

109
from ietf.group.models import Group
1110
from ietf.name.models import DBTemplateTypeName
@@ -19,7 +18,6 @@
1918
)
2019

2120

22-
@python_2_unicode_compatible
2321
class DBTemplate(models.Model):
2422
path = models.CharField( max_length=255, unique=True, blank=False, null=False, )
2523
title = models.CharField( max_length=255, blank=False, null=False, )

ietf/doc/models.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from django.urls import reverse as urlreverse
1717
from django.contrib.contenttypes.models import ContentType
1818
from django.conf import settings
19-
from django.utils.encoding import python_2_unicode_compatible, force_text
19+
from django.utils.encoding import force_text
2020
from django.utils.html import mark_safe # type:ignore
2121

2222
import debug # pyflakes:ignore
@@ -36,7 +36,6 @@
3636

3737
logger = logging.getLogger('django')
3838

39-
@python_2_unicode_compatible
4039
class StateType(models.Model):
4140
slug = models.CharField(primary_key=True, max_length=30) # draft, draft-iesg, charter, ...
4241
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):
5857
))
5958
return errors
6059

61-
@python_2_unicode_compatible
6260
class State(models.Model):
6361
type = ForeignKey(StateType)
6462
slug = models.SlugField()
@@ -543,7 +541,6 @@ class Meta:
543541

544542
STATUSCHANGE_RELATIONS = ('tops','tois','tohist','toinf','tobcp','toexp')
545543

546-
@python_2_unicode_compatible
547544
class RelatedDocument(models.Model):
548545
source = ForeignKey('Document')
549546
target = ForeignKey('DocAlias')
@@ -617,7 +614,6 @@ class Meta:
617614
abstract = True
618615
ordering = ["document", "order"]
619616

620-
@python_2_unicode_compatible
621617
class DocumentAuthor(DocumentAuthorInfo):
622618
document = ForeignKey('Document')
623619

@@ -631,7 +627,6 @@ def __str__(self):
631627
'invalid'
632628
)
633629

634-
@python_2_unicode_compatible
635630
class Document(DocumentInfo):
636631
name = models.CharField(max_length=255, validators=[validate_docname,], unique=True) # immutable
637632

@@ -866,15 +861,13 @@ class DocumentURL(models.Model):
866861
desc = models.CharField(max_length=255, default='', blank=True)
867862
url = models.URLField(max_length=2083) # 2083 is the legal max for URLs
868863

869-
@python_2_unicode_compatible
870864
class RelatedDocHistory(models.Model):
871865
source = ForeignKey('DocHistory')
872866
target = ForeignKey('DocAlias', related_name="reversely_related_document_history_set")
873867
relationship = ForeignKey(DocRelationshipName)
874868
def __str__(self):
875869
return u"%s %s %s" % (self.source.doc.name, self.relationship.name.lower(), self.target.name)
876870

877-
@python_2_unicode_compatible
878871
class DocHistoryAuthor(DocumentAuthorInfo):
879872
# use same naming convention as non-history version to make it a bit
880873
# easier to write generic code
@@ -883,7 +876,6 @@ class DocHistoryAuthor(DocumentAuthorInfo):
883876
def __str__(self):
884877
return u"%s %s (%s)" % (self.document.doc.name, self.person, self.order)
885878

886-
@python_2_unicode_compatible
887879
class DocHistory(DocumentInfo):
888880
doc = ForeignKey(Document, related_name="history_set")
889881
# the name here is used to capture the canonical name at the time
@@ -934,7 +926,6 @@ class Meta:
934926
verbose_name = "document history"
935927
verbose_name_plural = "document histories"
936928

937-
@python_2_unicode_compatible
938929
class DocAlias(models.Model):
939930
"""This is used for documents that may appear under multiple names,
940931
and in particular for RFCs, which for continuity still keep the
@@ -1042,7 +1033,6 @@ class DocReminder(models.Model):
10421033
("removed_related_ipr", "Removed related IPR"),
10431034
]
10441035

1045-
@python_2_unicode_compatible
10461036
class DocEvent(models.Model):
10471037
"""An occurrence for a document, used for tracking who, when and what."""
10481038
time = models.DateTimeField(default=datetime.datetime.now, help_text="When the event happened", db_index=True)
@@ -1086,7 +1076,6 @@ class ConsensusDocEvent(DocEvent):
10861076
consensus = models.NullBooleanField(default=None)
10871077

10881078
# IESG events
1089-
@python_2_unicode_compatible
10901079
class BallotType(models.Model):
10911080
doc_type = ForeignKey(DocTypeName, blank=True, null=True)
10921081
slug = models.SlugField()
@@ -1221,7 +1210,6 @@ class SubmissionDocEvent(DocEvent):
12211210
submission = ForeignKey(ietf.submit.models.Submission)
12221211

12231212
# dumping store for removed events
1224-
@python_2_unicode_compatible
12251213
class DeletedEvent(models.Model):
12261214
content_type = ForeignKey(ContentType)
12271215
json = models.TextField(help_text="Deleted object in JSON format, with attribute names chosen to be suitable for passing into the relevant create method.")

ietf/group/models.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from django.db import models
1616
from django.db.models.deletion import CASCADE
1717
from django.dispatch import receiver
18-
from django.utils.encoding import python_2_unicode_compatible
1918

2019
from simple_history.models import HistoricalRecords
2120

@@ -29,7 +28,6 @@
2928
from ietf.utils.models import ForeignKey, OneToOneField
3029

3130

32-
@python_2_unicode_compatible
3331
class GroupInfo(models.Model):
3432
time = models.DateTimeField(default=datetime.datetime.now)
3533
name = models.CharField(max_length=80)
@@ -252,7 +250,6 @@ class GroupHistory(GroupInfo):
252250
class Meta:
253251
verbose_name_plural="group histories"
254252

255-
@python_2_unicode_compatible
256253
class GroupURL(models.Model):
257254
group = ForeignKey(Group)
258255
name = models.CharField(max_length=255)
@@ -261,7 +258,6 @@ class GroupURL(models.Model):
261258
def __str__(self):
262259
return u"%s (%s)" % (self.url, self.name)
263260

264-
@python_2_unicode_compatible
265261
class GroupMilestoneInfo(models.Model):
266262
group = ForeignKey(Group)
267263
# a group has two sets of milestones, current milestones
@@ -289,7 +285,6 @@ class GroupMilestoneHistory(GroupMilestoneInfo):
289285
time = models.DateTimeField()
290286
milestone = ForeignKey(GroupMilestone, related_name="history_set")
291287

292-
@python_2_unicode_compatible
293288
class GroupStateTransitions(models.Model):
294289
"""Captures that a group has overriden the default available
295290
document state transitions for a certain state."""
@@ -310,7 +305,6 @@ def __str__(self):
310305
("status_update", "Status update"),
311306
]
312307

313-
@python_2_unicode_compatible
314308
class GroupEvent(models.Model):
315309
"""An occurrence for a group, used for tracking who, when and what."""
316310
group = ForeignKey(Group)
@@ -331,7 +325,6 @@ class ChangeStateGroupEvent(GroupEvent):
331325
class MilestoneGroupEvent(GroupEvent):
332326
milestone = ForeignKey(GroupMilestone)
333327

334-
@python_2_unicode_compatible
335328
class Role(models.Model):
336329
name = ForeignKey(RoleName)
337330
group = ForeignKey(Group)
@@ -349,7 +342,6 @@ def formatted_email(self):
349342
class Meta:
350343
ordering = ['name_id', ]
351344

352-
@python_2_unicode_compatible
353345
class RoleHistory(models.Model):
354346
# RoleHistory doesn't have a time field as it's not supposed to be
355347
# used on its own - there should always be a GroupHistory

ietf/iesg/models.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737
import datetime
3838

3939
from django.db import models
40-
from django.utils.encoding import python_2_unicode_compatible
4140

42-
@python_2_unicode_compatible
4341
class TelechatAgendaItem(models.Model):
4442
TYPE_CHOICES = (
4543
(1, "Any Other Business (WG News, New Proposals, etc.)"),
@@ -80,7 +78,6 @@ class TelechatDateManager(models.Manager):
8078
def active(self):
8179
return self.get_queryset().filter(date__gte=datetime.date.today())
8280

83-
@python_2_unicode_compatible
8481
class TelechatDate(models.Model):
8582
objects = TelechatDateManager()
8683

ietf/ipr/models.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
from django.conf import settings
88
from django.db import models
99
from django.urls import reverse
10-
from django.utils.encoding import python_2_unicode_compatible
1110

1211
from ietf.doc.models import DocAlias, DocEvent
1312
from ietf.name.models import DocRelationshipName,IprDisclosureStateName,IprLicenseTypeName,IprEventTypeName
1413
from ietf.person.models import Person
1514
from ietf.message.models import Message
1615
from ietf.utils.models import ForeignKey
1716

18-
@python_2_unicode_compatible
1917
class IprDisclosureBase(models.Model):
2018
by = ForeignKey(Person) # who was logged in, or System if nobody was logged in
2119
compliant = models.BooleanField("Complies to RFC3979", default=True)
@@ -158,7 +156,6 @@ class GenericIprDisclosure(IprDisclosureBase):
158156
holder_contact_info = models.TextField(blank=True, help_text="Address, phone, etc.")
159157
statement = models.TextField() # includes licensing info
160158

161-
@python_2_unicode_compatible
162159
class IprDocRel(models.Model):
163160
disclosure = ForeignKey(IprDisclosureBase)
164161
document = ForeignKey(DocAlias)
@@ -189,7 +186,6 @@ def __str__(self):
189186
else:
190187
return "%s which applies to %s" % (self.disclosure, self.document.name)
191188

192-
@python_2_unicode_compatible
193189
class RelatedIpr(models.Model):
194190
source = ForeignKey(IprDisclosureBase,related_name='relatedipr_source_set')
195191
target = ForeignKey(IprDisclosureBase,related_name='relatedipr_target_set')
@@ -198,7 +194,6 @@ class RelatedIpr(models.Model):
198194
def __str__(self):
199195
return "%s %s %s" % (self.source.title, self.relationship.name.lower(), self.target.title)
200196

201-
@python_2_unicode_compatible
202197
class IprEvent(models.Model):
203198
time = models.DateTimeField(auto_now_add=True)
204199
type = ForeignKey(IprEventTypeName)

ietf/liaisons/models.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from django.conf import settings
66
from django.urls import reverse as urlreverse
77
from django.db import models
8-
from django.utils.encoding import python_2_unicode_compatible
98
from django.utils.text import slugify
109

1110
from ietf.person.models import Email, Person
@@ -27,7 +26,6 @@
2726
}
2827

2928

30-
@python_2_unicode_compatible
3129
class LiaisonStatement(models.Model):
3230
title = models.CharField(max_length=255)
3331
from_groups = models.ManyToManyField(Group, blank=True, related_name='liaisonstatement_from_set')
@@ -201,7 +199,6 @@ def approver_emails(self):
201199
approval_set.intersection_update(group.liaison_approvers())
202200
return list(set([ r.email.address for r in approval_set ]))
203201

204-
@python_2_unicode_compatible
205202
class LiaisonStatementAttachment(models.Model):
206203
statement = ForeignKey(LiaisonStatement)
207204
document = ForeignKey(Document)
@@ -211,7 +208,6 @@ def __str__(self):
211208
return self.document.name
212209

213210

214-
@python_2_unicode_compatible
215211
class RelatedLiaisonStatement(models.Model):
216212
source = ForeignKey(LiaisonStatement, related_name='source_of_set')
217213
target = ForeignKey(LiaisonStatement, related_name='target_of_set')
@@ -221,7 +217,6 @@ def __str__(self):
221217
return "%s %s %s" % (self.source.title, self.relationship.name.lower(), self.target.title)
222218

223219

224-
@python_2_unicode_compatible
225220
class LiaisonStatementGroupContacts(models.Model):
226221
group = ForeignKey(Group, unique=True, null=True)
227222
contacts = models.CharField(max_length=255,blank=True)
@@ -231,7 +226,6 @@ def __str__(self):
231226
return "%s" % self.group.name
232227

233228

234-
@python_2_unicode_compatible
235229
class LiaisonStatementEvent(models.Model):
236230
time = models.DateTimeField(auto_now_add=True)
237231
type = ForeignKey(LiaisonStatementEventTypeName)

ietf/mailinglists/models.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
from django.conf import settings
66
from django.core.validators import validate_email
77
from django.db import models
8-
from django.utils.encoding import python_2_unicode_compatible
98

109
from ietf.person.models import Person
1110
from ietf.utils.models import ForeignKey
1211

13-
@python_2_unicode_compatible
1412
class List(models.Model):
1513
name = models.CharField(max_length=32)
1614
description = models.CharField(max_length=256)
@@ -21,7 +19,6 @@ def __str__(self):
2119
def info_url(self):
2220
return settings.MAILING_LIST_INFO_URL % {'list_addr': self.name }
2321

24-
@python_2_unicode_compatible
2522
class Subscribed(models.Model):
2623
time = models.DateTimeField(auto_now_add=True)
2724
email = models.CharField(max_length=128, validators=[validate_email])
@@ -31,7 +28,6 @@ def __str__(self):
3128
class Meta:
3229
verbose_name_plural = "Subscribed"
3330

34-
@python_2_unicode_compatible
3531
class Whitelisted(models.Model):
3632
time = models.DateTimeField(auto_now_add=True)
3733
email = models.CharField("Email address", max_length=64, validators=[validate_email])

0 commit comments

Comments
 (0)