Django 5.2 Upgrade#900
Conversation
Our default is `True` because many Ghostwriter installs cannot send the verification email and verification is unnecessary.
The unexpected scrolls/jumps were caused by TinyMCE loading and causing the viewport to scroll down to the activated field. These changes attempt to control that behavior.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a57532a4f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Upgrades Ghostwriter’s backend stack to Django 5.2 (and related dependency updates) and includes supporting changes across templates, health checks, tests, and CI to maintain functionality and reduce drift between backend schema and generated frontend GraphQL types.
Changes:
- Upgrade Django and core dependencies (incl. allauth MFA, crispy-forms, health checks, docx tooling) and adjust code/migrations/settings accordingly.
- Add a CI workflow to verify committed GraphQL codegen output is up-to-date when models/migrations/Hasura metadata change.
- Improve UI behavior: dashboard calendar now receives server-built event JSON, active report selection persists across sessions, tabs/TinyMCE initialization updated for better UX.
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| requirements/production.txt | Bumps production-only dependencies (gunicorn, django-anymail). |
| requirements/local.txt | Updates dev/test tooling versions (mypy, pytest, coverage, debug toolbar, etc.). |
| requirements/base.txt | Upgrades Django + core libs; switches docxtpl to fork; adds crispy-bootstrap4; updates health-check deps. |
| README.md | Updates Django badge to 5.2. |
| ghostwriter/users/tests/test_views.py | Adds MFA email-verification guard tests and uses override_settings. |
| ghostwriter/templates/tab-link.html | Updates tab link markup to support stable URL hashes + separate pane targets. |
| ghostwriter/templates/mfa/index.html | Updates MFA page layout classes for improved responsiveness. |
| ghostwriter/templates/index.html | Moves calendar event data into json_script and consumes it in FullCalendar. |
| ghostwriter/templates/base_generic.html | Adds localStorage-backed “active report” restore + tab hash targeting updates. |
| ghostwriter/templates/base_generic_empty.html | Mirrors active-report persistence + tab hash targeting for the empty layout. |
| ghostwriter/templates/account/password_change.html | Adds breadcrumbs block for password change page. |
| ghostwriter/templates/account/email.html | Adds breadcrumbs block for email management page. |
| ghostwriter/status/views.py | Migrates health check view implementation to HealthCheckView and explicit check list. |
| ghostwriter/status/templates/health_check.html | Updates health check template to render new status_results structure. |
| ghostwriter/status/migrations/0001_drop_legacy_health_check_db_table.py | Adds migration to drop legacy health-check DB table/metadata. |
| ghostwriter/status/apps.py | Removes plugin registration hook for Hasura health check (now explicitly listed in view). |
| ghostwriter/static/js/tinymce/config.js | Refactors TinyMCE init to avoid page scroll jumps and lazily init in tabs/modals. |
| ghostwriter/static/css/styles.css | Adds MFA card/action button styling helpers. |
| ghostwriter/shepherd/tests/test_views.py | Fixes invalid IPs used in duplicate-server test. |
| ghostwriter/shepherd/tests/test_forms.py | Stabilizes domain factory test data (names/statuses) for checkout tests. |
| ghostwriter/shepherd/models.py | Updates CheckConstraint arg to condition= for Django 5.x. |
| ghostwriter/rolodex/tests/test_views.py | Adds tests asserting initial active tab selection using BeautifulSoup. |
| ghostwriter/rolodex/templates/rolodex/project_form.html | Updates formset TinyMCE init to use new global init helper. |
| ghostwriter/rolodex/models.py | Updates CheckConstraint arg to condition= for Django 5.x. |
| ghostwriter/rolodex/admin.py | Updates list display to use tag_list helper. |
| ghostwriter/reporting/tests/test_views.py | Updates queryset assertion helper name for Django 5.x. |
| ghostwriter/reporting/tests/test_models.py | Adds regression test for docx lint initialization order with forked docxtpl. |
| ghostwriter/reporting/models.py | Updates “Untitled …” display strings and updates a constraint to condition=. |
| ghostwriter/reporting/migrations/0007_auto_20200110_0505.py | Removes tinymce dependency from historical migration field definition. |
| ghostwriter/reporting/migrations/0006_auto_20191122_2304.py | Removes tinymce dependency from historical migration field definitions. |
| ghostwriter/oplog/migrations/0001_initial.py | Removes tinymce dependency from historical migration field definition. |
| ghostwriter/modules/reportwriter/base/docx.py | Adjusts docx style access for forked docxtpl API. |
| ghostwriter/modules/health_utils.py | Updates Hasura health check implementation to new django-health-check API and adds timeouts. |
| ghostwriter/modules/custom_layout_object.py | Updates crispy layout object signatures and introduces stable tab hash/id behavior. |
| ghostwriter/home/views.py | Adds server-side calendar event builder using RBAC-aware project selection. |
| ghostwriter/home/tests/test_views.py | Expands dashboard tests for calendar visibility across roles/invites. |
| ghostwriter/factories.py | Fixes timezone import shadowing by aliasing datetime.timezone. |
| ghostwriter/commandcenter/models.py | Updates CheckConstraint arg to condition= for Django 5.x. |
| ghostwriter/api/models.py | Updates CheckConstraint args to condition= for Django 5.x. |
| config/settings/base.py | Updates installed apps (crispy-bootstrap4, health_check changes), removes legacy settings, adds MFA allow-unverified toggle. |
| compose/local/django/Dockerfile | Updates pip bootstrap step to upgrade setuptools + pip. |
| CHANGELOG.md | Adds 7.1.0 changelog entry describing the upgrade and feature changes. |
| .github/workflows/graphql-codegen.yml | Adds workflow to validate committed GraphQL generated sources are in sync. |
🤖 Augment PR SummarySummary: Upgrades Ghostwriter to Django 5.2 and refreshes the dependency stack, with supporting changes across health checks, forms, migrations, and UI. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #900 +/- ##
==========================================
+ Coverage 93.61% 93.77% +0.15%
==========================================
Files 404 406 +2
Lines 27687 27951 +264
==========================================
+ Hits 25920 26210 +290
+ Misses 1767 1741 -26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
These changes resolve a deprecation warning for `allauth` with the Django and app upgrades. It also fixes a 500 error that could occur when the auth service fails for some reason—e.g., a Microsoft Entra ID secret has expired or is invalid.
The migration now only drops the legacy health-check table and no longer modifies django_migrations.
These changes address a flash or flicker that could occur when adding formsets to a form. The init of TinyMCE caused this behavior along with some fade in/output animation this was doing to indicate the new formset. New formset fields not glow green for a short time after addition.
Added a scroll after a brief delay to let layout settle. Now scrolls down when a newly added formset is out of view.
CHANGELOG
[7.1.0] - TBD
Added
Changed
docxtplto a Ghostwriter fork to implement performance improvements (Fixes Large Observation results in High Load #585; Closes [Task] Identify a Path Forward for Docx Dependencies #822)docxtpldevelopment branchFixed