Skip to content

Commit b4f9cf5

Browse files
committed
feat(api): add order by created date on bulk upload api
1 parent 550fd7f commit b4f9cf5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

local_units/test_views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,11 +1057,11 @@ def setUp(self):
10571057
global_group.permissions.add(global_permission)
10581058
self.global_validator_user.groups.add(global_group)
10591059

1060-
file_path = os.path.join(settings.TEST_DIR, "local_unit/final-ad.csv")
1060+
file_path = os.path.join(settings.TEST_DIR, "local_unit/test.csv")
10611061
with open(file_path, "rb") as f:
10621062
self._file_content = f.read()
10631063

1064-
def create_upload_file(self, filename="final-ad.csv"):
1064+
def create_upload_file(self, filename="test.csv"):
10651065
"""
10661066
Always return a new file instance to prevent stream exhaustion.
10671067
"""

local_units/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class PrivateLocalUnitViewSet(viewsets.ModelViewSet):
7373
"level",
7474
)
7575
.exclude(is_deprecated=True)
76-
.order_by("validated", "modified_at")
76+
.order_by("validated", "-modified_at")
7777
)
7878
filterset_class = LocalUnitFilters
7979
search_fields = (
@@ -403,7 +403,7 @@ class LocalUnitBulkUploadViewSet(
403403
mixins.ListModelMixin,
404404
viewsets.GenericViewSet,
405405
):
406-
queryset = LocalUnitBulkUpload.objects.select_related("country", "local_unit_type", "triggered_by")
406+
queryset = LocalUnitBulkUpload.objects.select_related("country", "local_unit_type", "triggered_by").order_by("-triggered_at")
407407
permission_classes = [
408408
permissions.IsAuthenticated,
409409
DenyGuestUserPermission,

notifications/templates/email/local_units/local_unit.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ <h3>Dear {{full_name}}</h3>
3939

4040
{% if is_validator_regional_admin %}
4141
<td align="center" class="pb-30">
42-
The new local unit "{{local_branch_name}}" has been pending validation for over 14 days. Kindly review and validate or delete as necessary.
42+
The new local unit "{{local_branch_name}}" has been pending validation for over 7 days. Kindly review and validate or delete as necessary.
4343
</td>
4444
{% endif %}
4545

4646
{% if is_validator_global_admin %}
4747
<td align="center" class="pb-30">
48-
The new local unit "{{local_branch_name}}" has been pending validation for over 28 days and requires your attention. Please review and validate
48+
The new local unit "{{local_branch_name}}" has been pending validation for over 14 days and requires your attention. Please review and validate
4949
or delete as necessary.
5050
</td>
5151
{% endif %}

0 commit comments

Comments
 (0)