Skip to content

Commit 474d39d

Browse files
authored
Update to Django 5.2 LTS and Wagtail 7 LTS (#4666)
Fixes #4250 These are big updated so everything needs to be tested. Things to test: - [x] The complete login procedure. - [x] With enforce 2FA - [ ] For staff via Google - [x] Without password - [x] With password - [x] Forgot password - [x] Change password - [x] Add and remove 2FA - [x] The complete submission process for new and for old users. - [x] The complete review process for reviewers and for staff. - [x] Alla kind of file uploads and downloads. Do they work and do they have the correct permissions. - [x] Permissions for all important views. - [x] Notifications via slack, e-mail etc.
1 parent 10f89c4 commit 474d39d

42 files changed

Lines changed: 1301 additions & 1406 deletions

File tree

Some content is hidden

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

.github/workflows/hypha-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
.venv/bin/python manage.py makemigrations --dry-run --verbosity=3
8181
.venv/bin/python manage.py makemigrations --check
8282
83-
- name: Run django checks
83+
- name: Run django collectstatic
8484
if: matrix.group == 2
8585
run: |
8686
.venv/bin/python manage.py collectstatic --noinput --no-post-process --verbosity=1

docs/setup/deployment/production/stand-alone.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,6 @@ SERVER_EMAIL: app@example.org
257257
ANYMAIL_WEBHOOK_SECRET: [KEY]
258258
AWS_ACCESS_KEY_ID: [KEY]
259259
AWS_DEFAULT_ACL: None
260-
AWS_MIGRATION_ACCESS_KEY_ID: [KEY]
261-
AWS_MIGRATION_BUCKET_NAME: backup.example.org
262-
AWS_MIGRATION_SECRET_ACCESS_KEY: [KEY]
263260
AWS_PRIVATE_BUCKET_NAME: private.example.org
264261
AWS_PUBLIC_BUCKET_NAME: public.example.org
265262
AWS_PUBLIC_CUSTOM_DOMAIN: public.example.org

hypha/apply/apps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from wagtail.users.apps import WagtailUsersAppConfig
2+
3+
4+
class CustomUsersAppConfig(WagtailUsersAppConfig):
5+
user_viewset = "hypha.apply.users.admin_views.CustomUserViewSet"
6+
group_viewset = "hypha.apply.users.admin_views.CustomGroupViewSet"

hypha/apply/determinations/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ class Meta:
5151
form_fields = StreamField(
5252
DeterminationCustomFormFieldsBlock(),
5353
default=[],
54-
use_json_field=True,
5554
)
5655

5756
@property

hypha/apply/funds/models/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ApplicationForm(models.Model):
1313
wagtail_reference_index_ignore = True
1414

1515
name = models.CharField(max_length=255)
16-
form_fields = StreamField(ApplicationCustomFormFieldsBlock(), use_json_field=True)
16+
form_fields = StreamField(ApplicationCustomFormFieldsBlock())
1717

1818
panels = [
1919
FieldPanel("name"),

hypha/apply/funds/models/submissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ class ApplicationSubmission(
439439
metaclass=ApplicationSubmissionMetaclass,
440440
):
441441
form_data = models.JSONField(encoder=StreamFieldDataEncoder)
442-
form_fields = StreamField(ApplicationCustomFormFieldsBlock(), use_json_field=True)
442+
form_fields = StreamField(ApplicationCustomFormFieldsBlock())
443443
public_id = models.CharField(
444444
max_length=255, null=True, blank=True, unique=True, db_index=True
445445
)

hypha/apply/funds/templates/funds/admin/parent_chooser.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ <h2>{% blocktrans %}Choose a Fund{% endblocktrans %}</h2>
2121
{% csrf_token %}
2222

2323
<ul class="fields">
24-
{% include "wagtailadmin/shared/field_as_li.html" with field=form.parent_page %}
24+
<li>
25+
{% include "wagtailadmin/shared/field.html" with field=form.parent_page %}
26+
</li>
2527
<li>
2628
<button type="submit" class="button">{% trans 'Continue' %}</button>
2729
</li>

hypha/apply/projects/models/project.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ class Project(BaseStreamForm, AccessFormData, models.Model):
254254
status = models.TextField(choices=PROJECT_STATUS_CHOICES, default=DRAFT)
255255

256256
form_data = models.JSONField(encoder=StreamFieldDataEncoder, default=dict)
257-
form_fields = StreamField(
258-
ProjectFormCustomFormFieldsBlock(), null=True, use_json_field=True
259-
)
257+
form_fields = StreamField(ProjectFormCustomFormFieldsBlock(), null=True)
260258

261259
# tracks read/write state of the Project
262260
is_locked = models.BooleanField(default=False)
@@ -500,14 +498,12 @@ class ProjectSOW(BaseStreamForm, AccessFormData, models.Model):
500498
Project, related_name="sow", on_delete=models.CASCADE
501499
)
502500
form_data = models.JSONField(encoder=StreamFieldDataEncoder, default=dict)
503-
form_fields = StreamField(
504-
ProjectFormCustomFormFieldsBlock(), null=True, use_json_field=True
505-
)
501+
form_fields = StreamField(ProjectFormCustomFormFieldsBlock(), null=True)
506502

507503

508504
class ProjectBaseStreamForm(BaseStreamForm, models.Model):
509505
name = models.CharField(max_length=255)
510-
form_fields = StreamField(ProjectFormCustomFormFieldsBlock(), use_json_field=True)
506+
form_fields = StreamField(ProjectFormCustomFormFieldsBlock())
511507

512508
panels = [
513509
FieldPanel("name"),

hypha/apply/projects/reports/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ class Report(BaseStreamForm, AccessFormData, models.Model):
9595
form_fields = StreamField(
9696
# Re-use the Project Custom Form class. The original fields (used at the time of response) should be required.
9797
ProjectFormCustomFormFieldsBlock(),
98-
use_json_field=True,
9998
null=True,
10099
)
101100
form_data = models.JSONField(encoder=StreamFieldDataEncoder, default=dict)

hypha/apply/projects/reports/tests/test_models.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,35 +158,35 @@ def test_past_due(self):
158158
"""Test that past_due_reports includes overdue reports."""
159159
report = ReportFactory(past_due=True)
160160
config = report.project.report_config
161-
self.assertQuerysetEqual(
161+
self.assertQuerySetEqual(
162162
config.past_due_reports(), [report], transform=lambda x: x
163163
)
164164

165165
def test_past_due_has_drafts(self):
166166
"""Test that past_due_reports includes draft reports."""
167167
report = ReportFactory(past_due=True, is_draft=True)
168168
config = report.project.report_config
169-
self.assertQuerysetEqual(
169+
self.assertQuerySetEqual(
170170
config.past_due_reports(), [report], transform=lambda x: x
171171
)
172172

173173
def test_past_due_no_submitted(self):
174174
"""Test that past_due_reports excludes submitted reports."""
175175
report = ReportFactory(is_submitted=True, past_due=True)
176176
config = report.project.report_config
177-
self.assertQuerysetEqual(config.past_due_reports(), [], transform=lambda x: x)
177+
self.assertQuerySetEqual(config.past_due_reports(), [], transform=lambda x: x)
178178

179179
def test_past_due_no_future(self):
180180
"""Test that past_due_reports excludes future reports."""
181181
report = ReportFactory(end_date=self.today + relativedelta(days=1))
182182
config = report.project.report_config
183-
self.assertQuerysetEqual(config.past_due_reports(), [], transform=lambda x: x)
183+
self.assertQuerySetEqual(config.past_due_reports(), [], transform=lambda x: x)
184184

185185
def test_past_due_no_skipped(self):
186186
"""Test that past_due_reports excludes skipped reports."""
187187
report = ReportFactory(skipped=True, past_due=True)
188188
config = report.project.report_config
189-
self.assertQuerysetEqual(config.past_due_reports(), [], transform=lambda x: x)
189+
self.assertQuerySetEqual(config.past_due_reports(), [], transform=lambda x: x)
190190

191191

192192
class TestReport(TestCase):
@@ -232,19 +232,19 @@ def test_start_date_with_submitted(self):
232232
def test_queryset_done_includes_submitted(self):
233233
"""Test that done() queryset includes submitted reports."""
234234
report = ReportFactory(is_submitted=True)
235-
self.assertQuerysetEqual(Report.objects.done(), [report], transform=lambda x: x)
235+
self.assertQuerySetEqual(Report.objects.done(), [report], transform=lambda x: x)
236236

237237
def test_queryset_done_includes_skipped(self):
238238
"""Test that done() queryset includes skipped reports."""
239239
report = ReportFactory(skipped=True)
240-
self.assertQuerysetEqual(Report.objects.done(), [report], transform=lambda x: x)
240+
self.assertQuerySetEqual(Report.objects.done(), [report], transform=lambda x: x)
241241

242242
def test_queryset_done_doesnt_includes_draft(self):
243243
"""Test that done() queryset excludes draft reports."""
244244
ReportFactory(is_draft=True)
245-
self.assertQuerysetEqual(Report.objects.done(), [], transform=lambda x: x)
245+
self.assertQuerySetEqual(Report.objects.done(), [], transform=lambda x: x)
246246

247247
def test_queryset_done_doesnt_includes_to_do(self):
248248
"""Test that done() queryset excludes to-do reports."""
249249
ReportFactory()
250-
self.assertQuerysetEqual(Report.objects.done(), [], transform=lambda x: x)
250+
self.assertQuerySetEqual(Report.objects.done(), [], transform=lambda x: x)

0 commit comments

Comments
 (0)