Skip to content

Commit 624dc3a

Browse files
JacobCoffeeewdurbinezio-melotti
authored
feat: migration from 2.2 -> 3.2 -> 4.2 (#2520)
* feat: initial 2.2 -> 4.2 migration work * feat: minimum dependency changes required to get a live webserver:port log line * test(minutes): fixed minutes test * test(mailing): fixed mailing test * test(codesamples): fixed codesamples tests * test(downloads): fixed downloads tests note: unsure if "valid" * test(pages): fixed pages tests * test(successstories): fixed successstories tests * test(users): fixed users forms tests * test(events): fixed events tests * test(users): fixed users views tests * chore: hide my shame * chore: apply code review * harmonize docker-compose and ci.yml PG versions to prod * Update base-requirements.txt Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com> * chore: remove migrations, rebase latest * chore: apply code review * feat(db): generate migrations * fix: revert allauth version bump Resolves #2520 (comment) * fix: revert allauth account middlware used in later versions * chore: bump allauth version * Fixup tests that interact with django-allauth ACCOUNT_PREVENT_ENUMERATION ACCOUNT_PREVENT_ENUMERATION was introduced in django-allauth 0.52.0, and interferes with our expectations. This should probably be turned on! But for now disable it by default to keep the changeset minimal. Allauth _used_ to iterate over users to check for email uniquenss but stopped at some point, so we have to create an EmailAdress object for the user in the relevant test-case for duplicate emails * chore: bump django package version --------- Co-authored-by: Ee Durbin <ewdurbin@gmail.com> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
1 parent aefbaa1 commit 624dc3a

File tree

63 files changed

+684
-153
lines changed

Some content is hidden

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

63 files changed

+684
-153
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
services:
77
postgres:
8-
image: postgres:10.1
8+
image: postgres:15.3
99
env:
1010
POSTGRES_USER: postgres
1111
POSTGRES_PASSWORD: postgres

banners/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'banners.apps.BannersAppConfig'

base-requirements.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
dj-database-url==0.5.0
2-
django-pipeline==2.0.6
3-
django-sitetree==1.18.0
2+
django-pipeline==3.0.0 # 3.0.0 is first version that supports Django 4.2
3+
django-sitetree==1.18.0 # >=1.17.1 is (?) first version that supports Django 4.2
44
django-apptemplates==1.5
55
django-admin-interface==0.24.2
66
django-translation-aliases==0.1.0
7-
Django==2.2.28
7+
Django==4.2.16
88
docutils==0.12
99
Markdown==3.3.4
1010
cmarkgfm==0.6.0
@@ -22,32 +22,31 @@ chardet==4.0.0
2222
celery[redis]==5.3.6
2323
django-celery-beat==2.5.0
2424
# TODO: We may drop 'django-imagekit' completely.
25-
django-imagekit==4.0.2
25+
django-imagekit==5.0 # 5.0 is first version that supports Django 4.2
2626
django-haystack==3.2.1
2727
elasticsearch>=7,<8
2828
# TODO: 0.14.0 only supports Django 1.8 and 1.11.
29-
django-tastypie==0.14.3
29+
django-tastypie==0.14.6 # 0.14.6 is first version that supports Django 4.2
3030

3131
pytz==2021.1
3232
python-dateutil==2.8.2
3333

3434
requests[security]>=2.26.0
3535

36-
django-honeypot==1.0.1
37-
django-markupfield==2.0.0
38-
django-markupfield-helpers==0.1.1
36+
django-honeypot==1.0.4 # 1.0.4 is first version that supports Django 4.2
37+
django-markupfield==2.0.1
3938

40-
django-allauth==0.50.0
39+
django-allauth==0.57.2 # 0.55.0 is first version that supports Django 4.2
4140

4241
django-waffle==2.2.1
4342

44-
djangorestframework==3.12.2
43+
djangorestframework==3.14.0 # 3.14.0 is first version that supports Django 4.1, 4.2 support hasnt been "released"
4544
django-filter==2.4.0
4645
django-ordered-model==3.4.3
4746
django-widget-tweaks==1.4.8
4847
django-countries==7.2.1
4948
num2words==0.5.10
50-
django-polymorphic==3.0.0
49+
django-polymorphic==3.1.0 # 3.1.0 is first version that supports Django 4.0, unsure if it fully supports 4.2
5150
sorl-thumbnail==12.7.0
5251
django-extensions==3.1.4
5352
django-import-export==2.7.1

blogs/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'blogs.apps.BlogsAppConfig'

blogs/admin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ class BlogEntryAdmin(admin.ModelAdmin):
1010
date_hierarchy = 'pub_date'
1111
actions = ['sync_new_entries']
1212

13+
@admin.action(
14+
description="Sync new blog entries"
15+
)
1316
def sync_new_entries(self, request, queryset):
1417
call_command('update_blogs')
1518
self.message_user(request, "Blog entries updated.")
1619

17-
sync_new_entries.short_description = "Sync new blog entries"
1820

1921

2022
@admin.register(FeedAggregate)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.11 on 2024-09-05 17:10
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('blogs', '0002_remove_translations_and_contributors'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='relatedblog',
18+
name='creator',
19+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_creator', to=settings.AUTH_USER_MODEL),
20+
),
21+
migrations.AlterField(
22+
model_name='relatedblog',
23+
name='last_modified_by',
24+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_modified', to=settings.AUTH_USER_MODEL),
25+
),
26+
]

blogs/parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from django.conf import settings
55
from django.template.loader import render_to_string
6-
from django.utils.timezone import make_aware, utc
6+
from django.utils.timezone import make_aware
77

88
from boxes.models import Box
99
from .models import BlogEntry, Feed
@@ -16,7 +16,7 @@ def get_all_entries(feed_url):
1616

1717
for e in d['entries']:
1818
published = make_aware(
19-
datetime.datetime(*e['published_parsed'][:7]), timezone=utc
19+
datetime.datetime(*e['published_parsed'][:7]), timezone=datetime.timezone.utc
2020
)
2121

2222
entry = {

boxes/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'boxes.apps.BoxesAppConfig'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 4.2.11 on 2024-09-05 17:10
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
import django.db.models.deletion
6+
7+
8+
class Migration(migrations.Migration):
9+
10+
dependencies = [
11+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
12+
('boxes', '0003_auto_20171101_2138'),
13+
]
14+
15+
operations = [
16+
migrations.AlterField(
17+
model_name='box',
18+
name='creator',
19+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_creator', to=settings.AUTH_USER_MODEL),
20+
),
21+
migrations.AlterField(
22+
model_name='box',
23+
name='last_modified_by',
24+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='%(app_label)s_%(class)s_modified', to=settings.AUTH_USER_MODEL),
25+
),
26+
]

cms/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'cms.apps.CmsAppConfig'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy