mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #2448 from alphagov/alphabetical-sort-letter-brandings
Make letter brandings easier to find with sorting and filtering
This commit is contained in:
@@ -785,7 +785,14 @@ class LetterBranding(StripWhitespaceForm):
|
||||
|
||||
def __init__(self, choices=[], *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.dvla_org_id.choices = choices
|
||||
self.dvla_org_id.choices = list(sorted(
|
||||
choices,
|
||||
key=lambda choice: (
|
||||
choice[0] != kwargs.get('dvla_org_id'),
|
||||
choice[0] != '001',
|
||||
choice[1],
|
||||
),
|
||||
))
|
||||
|
||||
dvla_org_id = RadioField(
|
||||
'Which logo should this service’s letter have?',
|
||||
|
||||
Reference in New Issue
Block a user