Skip to content

Commit 2896ff0

Browse files
cslzchenJohnetordoffjwalz
authored
[ENG-3651] Django3 Upgrade (#10078)
PRs: * remove post-migrate signals from migration stream (#9964) * move createcachetable to post migrate signal (#9944) * [ENG-3836] Investigate waffle flags (#9950) * [ENG-3865] Create Licenses using post-migrate signal (#9961) * [ENG-3863] Move schema ensuring and schema blocks update to post-migrate signals (#9974) * [ENG-3868] Move blocked email domains to post-migrate signal (#9958) * [ENG-3866] Move citation style population out of migration stream (#9966) * [ENG-3867] Create Storage Regions on post migration signal (#9965) * [ENG-3836] Follow-up: Add PyYAML to Requirements (#9993) * [ENG-3862] Move post-migrate signal out of migration stream for default providers (#9971) * Remove unused password change view/route (#9985) * Update import paths and fix deprecated modules for Django 3 (#9983) * Update postgres backend and remove failover router for Django 3 (#10011) * Move file metadata population to unit test fixtures (#9994) * [Django Upgrade] Fix one sub-query slicing issue (#10012) * [Django Upgrade] Upgrade django-elasticsearch-metrics (#10021) * [Django Upgrade] Replace M2M direct assignment (#10010) * [Django Upgrade] Upgrade markdown and mdx_del_ins (#9984) * [Django Upgrade] Move schema activeness/visibility update to pytest fixtures (#10029) Commits: * Remove osf migrations * Remove addon migrations * Init migrations - osf * Init migrations - addons * Fix migration for NotableEmailDomain * Fix circular import with built-in admin migrations * Add a RunSQL migration to update indexes * Upgrade django to 3.2.15 (and related dependencies) * Make fields defined on typedmodels subclasses nullable * Add required on_delete=CASCADE (default) to FKs missing it * Fix django CORS whitelist settings due to origin definition update * Add/Enable missing templates and middlewares in api settings * Comment out admin permissions that clash with built-in "view" ones * Add migrations for django upgrade base fixes * Fix system check warnings for django admin * Fix django cache table creation * Enable django.contrib.sessions.middleware.SessionMiddleware * Use default truthy and falsy values from upgraded DRF 3.13.1 * Use JsonField from django.db.models and django.forms * Fix session cookie encoding/decoding by using ensure_str() * Use prefetch instead of Django include * Fix CORS for ORIGINS_WHITELIST * Rename auto generated migration for django3 upgrade fixes * Remove QuickFile check from get_serializer_class for FileDetail view * Add registration_schema to DraftRegistrationDetailSerializer * Add id to DraftRegistrationDetailSerializer * Fix middleware order and replace deprecated staticfiles with static * Fix and rework from_db_value & to_python for EncryptedJSONField * Fix admin login failure for django upgrade * Wrap generated keen_read_key with ensure_str * Clear cached storage region property when creating a new version * Do not notify in set_password() when creating a test user * Fix RegistrationFactory for django3 upgrade * Remove unused update_version_metadata in file node and update tests * Remove tests for django-include * Remove EGAP backfill command and tests * Set DEFAULT_AUTO_FIELD to django.db.models.AutoField (default value) * Replace deprecated NullBooleanField + add migrations * Replace deprecated url() with re_path() for api * Replace deprecated url() with re_path() for admin * Fix missing or insufficient permission test for admin preprints view * Fix admin user view tests by using HTTP response headers object * Fix duplicate view_node permissions in node and instn view tests * Rework refresh_from_db() to reload GFKs * Fix visible contributor query * Fix handle_archive_fail and its tests * Use a different schema to fix tests failure due to django3 upgrade * Update URLs for URL Validation tests with Django 3 * Improve to_internal_value() in NodeRelationshipField * Add alt fixtures to prevent both siblings & parent/child conflicts * Fix linked_by_nodes in node related counts test * Fix bugged NullBooleanField -> BooleanField migration * Re-make migrations for django3 upgrade and merge them into one Co-authored-by: Longze Chen <[email protected]> Co-authored-by: John Tordoff <[email protected]> Co-authored-by: Jon Walz <[email protected]>
1 parent d07206d commit 2896ff0

File tree

661 files changed

+4037
-17592
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

661 files changed

+4037
-17592
lines changed
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,55 @@
11
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.11.2 on 2017-07-07 15:19
2+
# Generated by Django 1.11.29 on 2022-08-17 19:15
33
from __future__ import unicode_literals
44

5-
from django.conf import settings
5+
import addons.base.models
66
from django.db import migrations, models
7-
import django.db.models.deletion
7+
import django_extensions.db.fields
88
import osf.models.base
99
import osf.utils.datetime_aware_jsonfield
10+
import osf.utils.fields
1011

1112

1213
class Migration(migrations.Migration):
1314

1415
initial = True
1516

1617
dependencies = [
17-
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
18-
('osf', '0042_auto_20170707_1019'),
1918
]
2019

2120
operations = [
2221
migrations.CreateModel(
2322
name='NodeSettings',
2423
fields=[
2524
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
25+
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
26+
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
2627
('_id', models.CharField(db_index=True, default=osf.models.base.generate_object_id, max_length=24, unique=True)),
27-
('deleted', models.BooleanField(default=False)),
28+
('is_deleted', models.BooleanField(default=False)),
29+
('deleted', osf.utils.fields.NonNaiveDateTimeField(blank=True, null=True)),
2830
('user', models.TextField(blank=True, null=True)),
2931
('repo', models.TextField(blank=True, null=True)),
3032
('hook_id', models.TextField(blank=True, null=True)),
31-
('external_account', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='addons_bitbucket_node_settings', to='osf.ExternalAccount')),
32-
('owner', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='addons_bitbucket_node_settings', to='osf.AbstractNode')),
3333
],
3434
options={
3535
'abstract': False,
3636
},
37+
bases=(models.Model, osf.models.base.QuerySetExplainMixin, addons.base.models.BaseStorageAddon),
3738
),
3839
migrations.CreateModel(
3940
name='UserSettings',
4041
fields=[
4142
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
43+
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
44+
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
4245
('_id', models.CharField(db_index=True, default=osf.models.base.generate_object_id, max_length=24, unique=True)),
43-
('deleted', models.BooleanField(default=False)),
46+
('is_deleted', models.BooleanField(default=False)),
47+
('deleted', osf.utils.fields.NonNaiveDateTimeField(blank=True, null=True)),
4448
('oauth_grants', osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONField(blank=True, default=dict, encoder=osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONEncoder)),
45-
('owner', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='addons_bitbucket_user_settings', to=settings.AUTH_USER_MODEL)),
4649
],
4750
options={
4851
'abstract': False,
4952
},
50-
),
51-
migrations.AddField(
52-
model_name='nodesettings',
53-
name='user_settings',
54-
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='addons_bitbucket.UserSettings'),
53+
bases=(models.Model, osf.models.base.QuerySetExplainMixin),
5554
),
5655
]

addons/bitbucket/migrations/0002_auto_20170808_1140.py

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.29 on 2022-08-17 19:15
3+
from __future__ import unicode_literals
4+
5+
from django.conf import settings
6+
from django.db import migrations, models
7+
import django.db.models.deletion
8+
9+
10+
class Migration(migrations.Migration):
11+
12+
initial = True
13+
14+
dependencies = [
15+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
16+
('addons_bitbucket', '0001_initial'),
17+
('osf', '0001_initial'),
18+
]
19+
20+
operations = [
21+
migrations.AddField(
22+
model_name='usersettings',
23+
name='owner',
24+
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='addons_bitbucket_user_settings', to=settings.AUTH_USER_MODEL),
25+
),
26+
migrations.AddField(
27+
model_name='nodesettings',
28+
name='external_account',
29+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='addons_bitbucket_node_settings', to='osf.ExternalAccount'),
30+
),
31+
migrations.AddField(
32+
model_name='nodesettings',
33+
name='owner',
34+
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='addons_bitbucket_node_settings', to='osf.AbstractNode'),
35+
),
36+
migrations.AddField(
37+
model_name='nodesettings',
38+
name='user_settings',
39+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='addons_bitbucket.UserSettings'),
40+
),
41+
]

addons/bitbucket/migrations/0003_rename_deleted_field.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

addons/box/migrations/0001_initial.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.9 on 2017-03-23 20:34
2+
# Generated by Django 1.11.29 on 2022-08-17 19:15
33
from __future__ import unicode_literals
44

5+
import addons.base.models
56
from django.db import migrations, models
7+
import django_extensions.db.fields
68
import osf.models.base
79
import osf.utils.datetime_aware_jsonfield
10+
import osf.utils.fields
811

912

1013
class Migration(migrations.Migration):
@@ -19,26 +22,34 @@ class Migration(migrations.Migration):
1922
name='NodeSettings',
2023
fields=[
2124
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
25+
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
26+
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
2227
('_id', models.CharField(db_index=True, default=osf.models.base.generate_object_id, max_length=24, unique=True)),
23-
('deleted', models.BooleanField(default=False)),
28+
('is_deleted', models.BooleanField(default=False)),
29+
('deleted', osf.utils.fields.NonNaiveDateTimeField(blank=True, null=True)),
2430
('folder_id', models.TextField(blank=True, null=True)),
2531
('folder_name', models.TextField(blank=True, null=True)),
2632
('folder_path', models.TextField(blank=True, null=True)),
2733
],
2834
options={
2935
'abstract': False,
3036
},
37+
bases=(models.Model, osf.models.base.QuerySetExplainMixin, addons.base.models.BaseStorageAddon),
3138
),
3239
migrations.CreateModel(
3340
name='UserSettings',
3441
fields=[
3542
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
43+
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
44+
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
3645
('_id', models.CharField(db_index=True, default=osf.models.base.generate_object_id, max_length=24, unique=True)),
37-
('deleted', models.BooleanField(default=False)),
38-
('oauth_grants', osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONField(blank=True, default=dict)),
46+
('is_deleted', models.BooleanField(default=False)),
47+
('deleted', osf.utils.fields.NonNaiveDateTimeField(blank=True, null=True)),
48+
('oauth_grants', osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONField(blank=True, default=dict, encoder=osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONEncoder)),
3949
],
4050
options={
4151
'abstract': False,
4252
},
53+
bases=(models.Model, osf.models.base.QuerySetExplainMixin),
4354
),
4455
]

addons/box/migrations/0002_auto_20170323_1534.py renamed to addons/box/migrations/0002_auto_20220817_1915.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.9 on 2017-03-23 20:34
2+
# Generated by Django 1.11.29 on 2022-08-17 19:15
33
from __future__ import unicode_literals
44

55
from django.conf import settings
@@ -12,9 +12,9 @@ class Migration(migrations.Migration):
1212
initial = True
1313

1414
dependencies = [
15+
('addons_box', '0001_initial'),
1516
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
1617
('osf', '0001_initial'),
17-
('addons_box', '0001_initial'),
1818
]
1919

2020
operations = [

addons/box/migrations/0003_auto_20170713_1125.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

addons/box/migrations/0004_rename_deleted_field.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

addons/dataverse/migrations/0001_initial.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.9 on 2017-03-23 20:34
2+
# Generated by Django 1.11.29 on 2022-08-17 19:15
33
from __future__ import unicode_literals
44

5+
import addons.base.models
56
from django.db import migrations, models
7+
import django_extensions.db.fields
68
import osf.models.base
79
import osf.utils.datetime_aware_jsonfield
10+
import osf.utils.fields
811

912

1013
class Migration(migrations.Migration):
@@ -19,8 +22,11 @@ class Migration(migrations.Migration):
1922
name='NodeSettings',
2023
fields=[
2124
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
25+
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
26+
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
2227
('_id', models.CharField(db_index=True, default=osf.models.base.generate_object_id, max_length=24, unique=True)),
23-
('deleted', models.BooleanField(default=False)),
28+
('is_deleted', models.BooleanField(default=False)),
29+
('deleted', osf.utils.fields.NonNaiveDateTimeField(blank=True, null=True)),
2430
('dataverse_alias', models.TextField(blank=True, null=True)),
2531
('dataverse', models.TextField(blank=True, null=True)),
2632
('dataset_doi', models.TextField(blank=True, null=True)),
@@ -30,17 +36,22 @@ class Migration(migrations.Migration):
3036
options={
3137
'abstract': False,
3238
},
39+
bases=(models.Model, osf.models.base.QuerySetExplainMixin, addons.base.models.BaseStorageAddon),
3340
),
3441
migrations.CreateModel(
3542
name='UserSettings',
3643
fields=[
3744
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
45+
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
46+
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
3847
('_id', models.CharField(db_index=True, default=osf.models.base.generate_object_id, max_length=24, unique=True)),
39-
('deleted', models.BooleanField(default=False)),
40-
('oauth_grants', osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONField(blank=True, default=dict)),
48+
('is_deleted', models.BooleanField(default=False)),
49+
('deleted', osf.utils.fields.NonNaiveDateTimeField(blank=True, null=True)),
50+
('oauth_grants', osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONField(blank=True, default=dict, encoder=osf.utils.datetime_aware_jsonfield.DateTimeAwareJSONEncoder)),
4151
],
4252
options={
4353
'abstract': False,
4454
},
55+
bases=(models.Model, osf.models.base.QuerySetExplainMixin),
4556
),
4657
]

addons/dataverse/migrations/0002_auto_20170323_1534.py renamed to addons/dataverse/migrations/0002_auto_20220817_1915.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.9 on 2017-03-23 20:34
2+
# Generated by Django 1.11.29 on 2022-08-17 19:15
33
from __future__ import unicode_literals
44

55
from django.conf import settings

0 commit comments

Comments
 (0)