Upgrade back-end code from Django 4.2 to 5.2 LTS - #8052
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughChangesDjango platform upgrade
Frontend logout flow
Sequence Diagram(s)sequenceDiagram
participant User
participant Router
participant Logout
participant AccountsLogout
participant LoginPage
User->>Router: Open command/logout
Router->>Logout: Lazy-load Logout
Logout->>AccountsLogout: POST /accounts/logout/
AccountsLogout-->>Logout: Return response
Logout->>LoginPage: Redirect with nextUrl
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Warning One or more dependencies are approaching or past End-of-Life. |
Triggered by ffecf67 on branch refs/heads/issue-8046
Triggered by d68dac5 on branch refs/heads/issue-8046
There was a problem hiding this comment.
I completed the manual testing:
- Labels are localized correctly and schema-config labels are respected
- Switching languages works correctly
- Logging out from several locations works without a flashing error
- Logging back in takes me to the splash screen
- General UI/UX testing
- WorkBench
- Attachments and attachment bulk upload
Everything worked as expected except that opening the Attachments panel displays two error dialogs. Both report:
'datetime.date' object has no attribute 'utcoffset'
Not sure if it's related to the upgrade. The Attachments features still worked after dismissing the dialogs.
|
@rijulpoudel I think that is outside of the scope of this PR, I think it is happening here: as that is the only place we use datetime.UTC, which is not a part of django. Might be a different issue to write up.
|
There was a problem hiding this comment.
- Ensure strings are localized correctly
- verify that labels are not raw schema labels, i.e. ensure schema config labels are respected.
- Ensure that switching languages behaves correctly.
- Log out from several locations
- Ensure that no error dialogs flash on the screen
- Logging back in takes you to the splash screen
- General UI/UX testing
- especially the workbench and attachments/attachment bulk upload
It's a bit difficult to tell if switching languages is behaving correctly, as several are incomplete, but from what I could see all of the expected areas were still localized.
Edited since I hadn't spotted Rijul's testing before I submitted my review--apologies! There's a lot of screenshots that can be moved over to the issue
Rijul's issue didn't exist in main from my testing. It appears that date fields having no utcoffset is causing issues saving or accessing any newly created records, since I created a record set from Workbench, and found that the timestamps were off, and that I could not open the recordset(s). This affects other new records, such as Collection Objects.
We should wait until this issue is fixed regardless of whether it's within the scope of this PR or not to check general UI/UX, as it's affecting the basic functionality.
Below are all of the screenshots of the UTC offset issues I got.
When opening the record set(s):

Specify 7 Crash Report - 2026-07-29T16_47_28.993Z.txt
There are some oddities in timestamps because of this. Newly created record sets/queries appear to have a different timestamp from main. Above is an example--the two recordset created '5 hours ago' were actually created in main, recently, while the one recordset created an hour ago (ID 498) was created in the branch and appears to be accurate. On main, recordset 498 has a timestamp of 'now.'
Further evidence: from the branch, you can see that it the most recent query was created 15 minutes ago. This is accurate. On main, however, the timestamp created says 'now.'
Database is sdnhmherps_2026_07_17 with a login of sdnhmherp for verification/testing, as well. If this gets split into another issue, I'll move all of this over.
Thank you for the work on this Eos! 🫡
|
I don't think this should be a different issue actually. I combed through the Django release notes again, as well as our Django settings, saw something I missed. In 5.0, they set the default value for |
There was a problem hiding this comment.
- Ensure strings are localized correctly
- verify that labels are not raw schema labels, i.e. ensure schema config labels are respected.
- Ensure that switching languages behaves correctly.
- Log out from several locations
- Ensure that no error dialogs flash on the screen
- Logging back in takes you to the splash screen
- General UI/UX testing
- especially the workbench and attachments/attachment bulk upload
All tests pass like before and no error message on the Attachment Panel this time. I did not encounter any crashes, utcoffset errors, flashing error dialogs, or other UI regressions. Excellent job Eos!





Fixes #8046
Upgrade Django from 4.2 to LTS version 5.2.
https://docs.djangoproject.com/en/6.0/releases/5.2/
Changes:
USE_L10N(A localization setting, that is now defaulted to true)GETrequest to logout to aPOSTrequest to be in HTTP (and django) speclogOutuser tool (inHeader/userToolDefinitions) to point to a new front-end endpoint:/specify/command/logoutto match the cache clearing endpointRouter/Routes.tsx) renders theLogoutcomponentLogoutcomponent makes the POST request to the backend and returns a loading screenChecklist
self-explanatory (or properly documented)
Testing instructions
Note for dev testers
If you are testing on your local instance, change
specify7/docker-compose.yml
Line 61 in 4da3228
from
--mode developmentto--mode production. This is because in development mode, webpack will duplicate web requests, which when sending thePOSTrequest, the first one is aborted by the second, which causes ajax to flash an error on-screen before refreshing to the login page. This does not happen in production mode, as far as I have seen.Summary by CodeRabbit
New Features
Bug Fixes
Refactor