mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
backups: Sort list of apps in backup, restore, and schedules
Fixes: #2364 Tests: - Set language to English. Go to backups -> create. List of apps is sorted alphabetically and case is ignored. Take a backup. - Click on restore for the new backup. The list of apps is again sorted alphabetically and case is ignored. - Click on schedules. List of apps is sorted and alphabetically and case is ignored. - Repeat tests with Spanish locale. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
15e9c6cad9
commit
e6fb96b381
@ -29,14 +29,14 @@ def _get_app_choices(components):
|
|||||||
"""Return a list of check box multiple choices from list of components."""
|
"""Return a list of check box multiple choices from list of components."""
|
||||||
choices = []
|
choices = []
|
||||||
for component in components:
|
for component in components:
|
||||||
name = component.app.info.name
|
name = str(component.app.info.name)
|
||||||
if not component.has_data:
|
if not component.has_data:
|
||||||
name = gettext('{app} (No data to backup)').format(
|
name = gettext('{app} (No data to backup)').format(
|
||||||
app=component.app.info.name)
|
app=component.app.info.name)
|
||||||
|
|
||||||
choices.append((component.app_id, name))
|
choices.append((component.app_id, name))
|
||||||
|
|
||||||
return choices
|
return sorted(choices, key=lambda choice: choice[1].lower())
|
||||||
|
|
||||||
|
|
||||||
def _get_repository_choices():
|
def _get_repository_choices():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user