diff --git a/doc/release/RELEASE-NOTES.md b/doc/release/RELEASE-NOTES.md index 5b076c6d5..5b98056b4 100644 --- a/doc/release/RELEASE-NOTES.md +++ b/doc/release/RELEASE-NOTES.md @@ -27,6 +27,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html * [OSDEV-1532](https://opensupplyhub.atlassian.net/browse/OSDEV-1532) - Fixed the date range picker on the `Moderation Queue` page. A Data Moderator can change the Before date even if an Error message is displayed. * [OSDEV-1533](https://opensupplyhub.atlassian.net/browse/OSDEV-1533) - The presentation of the `Moderation Decision Date` in the `Moderation Queue` table has been corrected. If the "status_change_date" is missing in the object, it now displays as "N/A". * [OSDEV-1556](https://opensupplyhub.atlassian.net/browse/OSDEV-1556) - Fixed validation of `os_id` for PATCH `/api/v1/moderation-events/{moderation_id}/production-locations/{os_id}/` endpoint. +* [OSDEV-1563](https://opensupplyhub.atlassian.net/browse/OSDEV-1563) - Fixed updating of the moderation decision date after moderation event approval. ### What's new * [OSDEV-1376](https://opensupplyhub.atlassian.net/browse/OSDEV-1376) - Updated automated emails for closure reports (report_result) to remove the term "Rejected" for an improved user experience. Added link to Closure Policy and instructions for submitting a Reopening Report to make the process easier to understand for users. diff --git a/src/django/api/moderation_event_actions/approval/event_approval_template.py b/src/django/api/moderation_event_actions/approval/event_approval_template.py index 8ffa590ad..6d6a4fad3 100644 --- a/src/django/api/moderation_event_actions/approval/event_approval_template.py +++ b/src/django/api/moderation_event_actions/approval/event_approval_template.py @@ -271,6 +271,7 @@ def __create_facility_match_record( @staticmethod def _update_event(event: ModerationEvent, item: FacilityListItem) -> None: event.status = ModerationEvent.Status.APPROVED + event.status_change_date = timezone.now() event.os_id = item.facility_id event.save() diff --git a/src/django/api/tests/base_moderation_events_production_location_test.py b/src/django/api/tests/base_moderation_events_production_location_test.py index 94c3dfd55..ce6066fcf 100644 --- a/src/django/api/tests/base_moderation_events_production_location_test.py +++ b/src/django/api/tests/base_moderation_events_production_location_test.py @@ -153,6 +153,7 @@ def assert_success_response(self, response, status_code): uuid=self.moderation_event_id ) self.assertEqual(moderation_event.status, 'APPROVED') + self.assertIsNotNone(moderation_event.status_change_date) self.assertEqual(moderation_event.os_id, response.data["os_id"]) def assert_source_creation(self, source):