diff --git a/passbook/core/templatetags/passbook_user_settings.py b/passbook/core/templatetags/passbook_user_settings.py index 1af1b9c97..c04860627 100644 --- a/passbook/core/templatetags/passbook_user_settings.py +++ b/passbook/core/templatetags/passbook_user_settings.py @@ -23,7 +23,7 @@ def user_stages(context: RequestContext) -> List[UIUserSettings]: if not user_settings: continue matching_stages.append(user_settings) - return matching_stages + return sorted(matching_stages, key=lambda x: x.name) @register.simple_tag(takes_context=True) @@ -42,4 +42,4 @@ def user_sources(context: RequestContext) -> List[UIUserSettings]: policy_engine.build() if policy_engine.passing: matching_sources.append(user_settings) - return matching_sources + return sorted(matching_sources, key=lambda x: x.name)