Skip to content

Commit 09e573a

Browse files
authored
Use natural sort when access fastest media (#2336)
* Use natural sort when access fastest media * Fix mediamigrations IP order
1 parent 952e192 commit 09e573a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

ESSArch_Core/frontend/static/frontend/lang/sv/export.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default ($translateProvider: ng.translate.ITranslateProvider) => {
55
EXPORT: 'Export',
66
EXPORT_AS_JSON: 'Exportera som JSON',
77
EXPORT_PROFILE: 'Exportera profil',
8-
EXPORT_SUBMISSION_AGREEMENT: 'Exportera leveransöverenskollelse',
8+
EXPORT_SUBMISSION_AGREEMENT: 'Exportera leveransöverenskommelse',
99
},
1010
});
1111
};

ESSArch_Core/storage/models.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,8 @@ def migratable(self, export_path='', missing_storage=False):
545545
def non_migratable(self):
546546
return self.exclude(pk__in=self.migratable())
547547

548-
def natural_sort(self):
549-
return natural_sort(self, 'medium_id')
548+
def natural_sort(self, column='medium_id'):
549+
return natural_sort(self, column)
550550

551551
def fastest(self):
552552
container = Case(
@@ -734,8 +734,8 @@ def readable(self):
734734
storage_medium__status__in=[20, 30]
735735
)
736736

737-
def natural_sort(self):
738-
return natural_sort(self, 'content_location_value')
737+
def natural_sort(self, column='content_location_value'):
738+
return natural_sort(self, column)
739739

740740
def fastest(self):
741741
container = Case(
@@ -763,7 +763,8 @@ def fastest(self):
763763
remote=remote,
764764
storage_type=storage_type,
765765
content_location_value_int=content_location_value_int,
766-
).order_by('remote', 'container_order', 'storage_type', 'storage_medium', 'content_location_value_int')
766+
).order_by('remote', 'container_order', 'storage_type').natural_sort('storage_medium__medium_id'
767+
).order_by('content_location_value_int')
767768

768769

769770
class StorageObject(models.Model):
@@ -1092,8 +1093,8 @@ def __str__(self):
10921093

10931094

10941095
class TapeSlotQueryset(models.QuerySet):
1095-
def natural_sort(self):
1096-
return natural_sort(self, 'medium_id')
1096+
def natural_sort(self, column='medium_id'):
1097+
return natural_sort(self, column)
10971098

10981099

10991100
class TapeSlot(models.Model):

0 commit comments

Comments
 (0)