Skip to content

Commit

Permalink
Merge branch 'main' into OSDEV-899/move-react-to-s3
Browse files Browse the repository at this point in the history
  • Loading branch information
roninzp authored Dec 13, 2024
2 parents 5f04854 + fee6700 commit 0a7a8de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/release/RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

### Bugfix
* [OSDEV-1492](https://opensupplyhub.atlassian.net/browse/OSDEV-1492) - Fixed an issue where invalid manually entered dates were not validated on the UI, resulting in API errors with message “The request query is invalid.” on `Moderation Queue` page. Invalid dates are now trimmed and properly handled.
* [OSDEV-1493](https://opensupplyhub.atlassian.net/browse/OSDEV-1493) - Fixed an issue where the backend sorts countries not by `name` but by their `alpha-2 codes` in `GET /api/v1/moderation-events/` endpoint.

### What's new

Expand Down
5 changes: 5 additions & 0 deletions src/django/api/tests/test_moderation_events_query_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ def test_add_sort(self):
expected = {'created_at': {'order': 'asc'}}
self.assertIn(expected, self.builder.query_body['sort'])

def test_add_sort_country(self):
self.builder.add_sort('country', 'asc')
expected = {'cleaned_data.country.name': {'order': 'asc'}}
self.assertIn(expected, self.builder.query_body['sort'])

def test_add_search_after(self):
search_after_value = '2023-11-21T10:00:00'
search_after_id = '123e4567-e89b-12d3-a456-426614174000'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def add_sort(self, field, order_by=None):
{
'cleaned_data.' +
field +
'.alpha_2': {'order': order_by}
'.name': {'order': order_by}
}
)
else:
Expand Down

0 comments on commit 0a7a8de

Please sign in to comment.