4
4
5
5
import fnmatch
6
6
import logging
7
- import re
8
7
import os
8
+ import re
9
9
from urllib .parse import urlparse
10
10
11
11
from django .conf import settings
12
12
from django .contrib .auth .models import User
13
13
from django .db import models
14
14
from django .urls import NoReverseMatch , reverse
15
- from django .utils .encoding import python_2_unicode_compatible
16
15
from django .utils .functional import cached_property
17
16
from django .utils .translation import ugettext_lazy as _
18
17
from django_extensions .db .models import TimeStampedModel
47
46
log = logging .getLogger (__name__ )
48
47
49
48
50
- @python_2_unicode_compatible
51
49
class ProjectRelationship (models .Model ):
52
50
53
51
"""
@@ -89,7 +87,6 @@ def get_absolute_url(self):
89
87
return resolve (self .child )
90
88
91
89
92
- @python_2_unicode_compatible
93
90
class Project (models .Model ):
94
91
95
92
"""Project model."""
@@ -1070,7 +1067,6 @@ def environment_variables(self):
1070
1067
return self ._environment_variables
1071
1068
1072
1069
1073
- @python_2_unicode_compatible
1074
1070
class ImportedFile (models .Model ):
1075
1071
1076
1072
"""
@@ -1127,7 +1123,11 @@ def json_file_path(self):
1127
1123
basename = os .path .splitext (self .path )[0 ]
1128
1124
if self .project .documentation_type == 'sphinx_htmldir' and basename .endswith ('/index' ):
1129
1125
new_basename = re .sub (r'\/index$' , '' , basename )
1130
- log .info ('Adjusted json file path: %s -> %s' , basename , new_basename )
1126
+ log .info (
1127
+ 'Adjusted json file path: %s -> %s' ,
1128
+ basename ,
1129
+ new_basename ,
1130
+ )
1131
1131
basename = new_basename
1132
1132
1133
1133
file_path = basename + '.fjson'
@@ -1169,15 +1169,13 @@ class Meta:
1169
1169
abstract = True
1170
1170
1171
1171
1172
- @python_2_unicode_compatible
1173
1172
class EmailHook (Notification ):
1174
1173
email = models .EmailField ()
1175
1174
1176
1175
def __str__ (self ):
1177
1176
return self .email
1178
1177
1179
1178
1180
- @python_2_unicode_compatible
1181
1179
class WebHook (Notification ):
1182
1180
url = models .URLField (
1183
1181
max_length = 600 ,
@@ -1189,7 +1187,6 @@ def __str__(self):
1189
1187
return self .url
1190
1188
1191
1189
1192
- @python_2_unicode_compatible
1193
1190
class Domain (models .Model ):
1194
1191
1195
1192
"""A custom domain name for a project."""
@@ -1261,7 +1258,6 @@ def delete(self, *args, **kwargs): # pylint: disable=arguments-differ
1261
1258
super ().delete (* args , ** kwargs )
1262
1259
1263
1260
1264
- @python_2_unicode_compatible
1265
1261
class Feature (models .Model ):
1266
1262
1267
1263
"""
@@ -1352,7 +1348,6 @@ def get_feature_display(self):
1352
1348
return dict (self .FEATURES ).get (self .feature_id , self .feature_id )
1353
1349
1354
1350
1355
- @python_2_unicode_compatible
1356
1351
class EnvironmentVariable (TimeStampedModel , models .Model ):
1357
1352
name = models .CharField (
1358
1353
max_length = 128 ,
0 commit comments