Sort contact lists appropriately

On the uploads page this should be newest first, same as the scheduled
and immediate jobs on this page.

On the _choose_ page this should be alphabetical, same as choosing a
template.
This commit is contained in:
Chris Hill-Scott
2020-03-16 11:05:26 +00:00
parent 050f98fea6
commit b99216173e
3 changed files with 24 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ from app.main.forms import (
SetSenderForm,
get_placeholder_form_instance,
)
from app.models.contact_list import ContactList, ContactLists
from app.models.contact_list import ContactList, ContactListsAlphabetical
from app.models.user import Users
from app.s3_client.s3_csv_client import (
s3download,
@@ -506,7 +506,7 @@ def choose_from_contact_list(service_id, template_id):
)
return render_template(
'views/send-contact-list.html',
contact_lists=ContactLists(
contact_lists=ContactListsAlphabetical(
current_service.id,
template_type=template.template_type,
),