Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

[ERP-4737] Fix timestamp comparison - #789

Merged
Adam Smith (ScriptSmith) merged 1 commit into
next_releasefrom
ERP-4737-timestamp-comparison
May 21, 2026
Merged

Adam Smith (ScriptSmith) merged 1 commit into
next_releasefrom
ERP-4737-timestamp-comparison

Conversation

@ScriptSmith

@ScriptSmith Adam Smith (ScriptSmith) commented May 21, 2026 •

Copy link
Copy Markdown
Member

Fixes a 500 (TypeError: can't compare offset-naive and offset-aware datetimes) on form save: since the Django 5 upgrade flipped USE_TZ to True, timezone.now() is now timezone-aware, but clinical-data timestamps stored before the upgrade are naive ISO strings, so comparing them during the form-progress currency calculation raised a TypeError. This normalises naive datetimes to aware in parse_iso_datetime (and the two Patient currency helpers that compare stored timestamps) so legacy and new timestamps compare safely.

@ScriptSmith
Adam Smith (ScriptSmith) merged commit c8a7019 into next_release May 21, 2026
8 checks passed
@ScriptSmith
Adam Smith (ScriptSmith) deleted the ERP-4737-timestamp-comparison branch May 21, 2026 22:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant