Sort selected item to the top

When you land on the page it’s good to be able to quickly see what the
currently-set value is, before you change it.

This is unnecessarily hard if the selected item is buried half way down
the page. This commit moves it to the top.
This commit is contained in:
Chris Hill-Scott
2018-11-05 13:47:31 +00:00
parent c960fef8f8
commit 43988661d6
2 changed files with 23 additions and 13 deletions

View File

@@ -788,6 +788,7 @@ class LetterBranding(StripWhitespaceForm):
self.dvla_org_id.choices = list(sorted(
choices,
key=lambda choice: (
choice[0] != kwargs.get('dvla_org_id'),
choice[0] != '001',
choice[1],
),