Skip to content

Commit 711ac75

Browse files
pefoley2Laur04
authored andcommitted
build: django 3 compat changes
Fix various issues preventing an upgrade to django 3.2
1 parent 5503c4b commit 711ac75

File tree

19 files changed

+44
-21
lines changed

19 files changed

+44
-21
lines changed

Ion.egg-info/SOURCES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ intranet/apps/users/migrations/0032_userdarkmodeproperties.py
734734
intranet/apps/users/migrations/0033_user_last_global_logout_time.py
735735
intranet/apps/users/migrations/0034_remove_userdarkmodeproperties__dark_mode_unlocked.py
736736
intranet/apps/users/migrations/0035_auto_20200810_1547.py
737+
intranet/apps/users/migrations/0036_auto_20210530_0010.py
737738
intranet/apps/users/migrations/__init__.py
738739
intranet/apps/users/templatetags/__init__.py
739740
intranet/apps/users/templatetags/grades.py

Ion.egg-info/requires.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ Fabric3==1.14.post1
3535
flower==0.9.7
3636
gunicorn==20.1.0
3737
hiredis==2.0.0
38-
ipython==7.24.0
38+
ipython==7.24.1
3939
objgraph==3.5.0
4040
pexpect==4.8.0
4141
prometheus-client==0.8.0
4242
psycopg2==2.8.6
4343
pycryptodome==3.10.1
4444
pysftp==0.2.9
4545
python-dateutil==2.8.1
46-
python-magic==0.4.22
46+
python-magic==0.4.24
4747
reportlab==3.5.67
4848
requests==2.25.1
4949
requests-oauthlib==1.3.0

ci/regen-workflow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
2+
import json
23
import os
34
import sys
4-
import json
55

66
try:
77
import yaml

docs/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
from datetime import datetime
1818
from unittest import mock
1919

20-
import django
2120
import sphinx_bootstrap_theme
2221

22+
import django
23+
2324
# If extensions (or modules to document with autodoc) are in another directory,
2425
# add these directories to sys.path here. If the directory is relative to the
2526
# documentation root, use os.path.abspath to make it absolute, like shown here.

docs/rtd-requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ Fabric3==1.14.post1
3535
flower==0.9.7
3636
gunicorn==20.1.0
3737
hiredis==2.0.0
38-
ipython==7.24.0
38+
ipython==7.24.1
3939
objgraph==3.5.0
4040
pexpect==4.8.0
4141
prometheus-client==0.8.0 # pinned for flower
4242
psycopg2==2.8.6
4343
pycryptodome==3.10.1
4444
pysftp==0.2.9
4545
python-dateutil==2.8.1
46-
python-magic==0.4.22
46+
python-magic==0.4.24
4747
reportlab==3.5.67
4848
requests==2.25.1
4949
requests-oauthlib==1.3.0

fabfile.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import os
22
import traceback
33

4+
import pkg_resources
45
from fabric.api import abort, env, hide, lcd, local, prefix, prompt, puts, shell_env
56
from fabric.contrib.console import confirm
67

7-
import pkg_resources
8-
98
PRODUCTION_DOCUMENT_ROOT = "/usr/local/www/intranet3"
109
REDIS_SESSION_DB = 0
1110
REDIS_PRODUCTION_CACHE_DB = 1

intranet/apps/auth/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class AuthConfig(AppConfig):
55
name = "intranet.apps.auth"
6-
label = "intranet.apps.auth"
6+
label = "intranet_auth"

intranet/apps/dataimport/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class DataimportConfig(AppConfig):
5-
name = "dataimport"
5+
name = "intranet.apps.dataimport"

intranet/apps/emailfwd/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class EmailfwdConfig(AppConfig):
5-
name = "emailfwd"
5+
name = "intranet.apps.emailfwd"

intranet/apps/itemreg/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class ItemregConfig(AppConfig):
5-
name = "itemreg"
5+
name = "intranet.apps.itemreg"

intranet/apps/lostfound/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class LostfoundConfig(AppConfig):
5-
name = "lostfound"
5+
name = "intranet.apps.lostfound"

intranet/apps/nomination/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class NominationConfig(AppConfig):
5-
name = "nomination"
5+
name = "intranet.apps.nomination"

intranet/apps/parking/apps.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class ParkingConfig(AppConfig):
5-
name = "parking"
5+
name = "intranet.apps.parking"

intranet/apps/templatetags/form_field.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from django import template
2-
from django.forms.forms import BoundField
2+
from django.forms.boundfield import BoundField
33

44
register = template.Library()
55

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.1.11 on 2021-05-30 04:10
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('users', '0035_auto_20200810_1547'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='user',
15+
name='gender',
16+
field=models.BooleanField(null=True),
17+
),
18+
]

intranet/apps/users/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class User(AbstractBaseUser, PermissionsMixin):
225225
middle_name = models.CharField(max_length=70, null=True)
226226
last_name = models.CharField(max_length=70, null=True)
227227
nickname = models.CharField(max_length=35, null=True)
228-
gender = models.NullBooleanField()
228+
gender = models.BooleanField(null=True)
229229
preferred_photo = models.OneToOneField("Photo", related_name="+", null=True, blank=True, on_delete=models.SET_NULL)
230230
primary_email = models.OneToOneField("Email", related_name="+", null=True, blank=True, on_delete=models.SET_NULL)
231231
bus_route = models.ForeignKey(Route, on_delete=models.SET_NULL, null=True)

intranet/settings/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@
358358
),
359359
"debug": True, # Only enabled if DEBUG is true as well
360360
"loaders": ("django.template.loaders.filesystem.Loader", "django.template.loaders.app_directories.Loader"),
361-
"libraries": {"staticfiles": "django.contrib.staticfiles.templatetags.staticfiles"},
361+
"libraries": {"staticfiles": "django.templatetags.static"},
362362
},
363363
}
364364
] # type: List[Dict[str,Any]]
@@ -833,6 +833,8 @@ def get_log(name): # pylint: disable=redefined-outer-name; 'name' is used as th
833833
# Shows a warning message with yellow background on the login and all interior pages
834834
# GLOBAL_WARNING = "This is a message to display throughout the application."
835835

836+
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
837+
836838
try:
837839
from .secret import * # noqa
838840
except ImportError:

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ Fabric3==1.14.post1
3535
flower==0.9.7
3636
gunicorn==20.1.0
3737
hiredis==2.0.0
38-
ipython==7.24.0
38+
ipython==7.24.1
3939
objgraph==3.5.0
4040
pexpect==4.8.0
4141
prometheus-client==0.8.0 # pinned for flower
4242
psycopg2==2.8.6
4343
pycryptodome==3.10.1
4444
pysftp==0.2.9
4545
python-dateutil==2.8.1
46-
python-magic==0.4.22
46+
python-magic==0.4.24
4747
reportlab==3.5.67
4848
requests==2.25.1
4949
requests-oauthlib==1.3.0

scripts/get_ldif.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import sys
2+
13
from django.forms.models import model_to_dict
4+
25
from intranet.apps.users.models import User
3-
import sys
46

57

68
def run(*args):

0 commit comments

Comments
 (0)