Skip to content

Commit

Permalink
Small updates for issues found in manual testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathangreen committed Nov 3, 2023
1 parent b1c284f commit eafb469
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
7 changes: 4 additions & 3 deletions api/admin/controller/integration_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def default_registry(self) -> IntegrationRegistry[T]:
@memoize(ttls=1800)
def _cached_protocols(self) -> Dict[str, Dict[str, Any]]:
"""Cached result for integration implementations"""
protocols = {}
protocols = []
for name, api in self.registry:
protocol = {
"name": name,
Expand All @@ -81,8 +81,9 @@ def _cached_protocols(self) -> Dict[str, Dict[str, Any]]:
"child_settings"
] = api.child_settings_class().configuration_form(self._db)
protocol.update(api.protocol_details(self._db))
protocols[name] = protocol
return protocols
protocols.append((name, protocol))
protocols.sort(key=lambda x: x[0])
return dict(protocols)

@property
def protocols(self) -> Dict[str, Dict[str, Any]]:
Expand Down
2 changes: 1 addition & 1 deletion api/odl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from core.model.patron import Hold, Loan, Patron


class ODL2Settings(OPDS2ImporterSettings, ODLSettings):
class ODL2Settings(ODLSettings, OPDS2ImporterSettings):
skipped_license_formats: List[str] = FormField(
default=["text/html"],
alias="odl2_skipped_license_formats",
Expand Down
8 changes: 4 additions & 4 deletions core/opds_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ class OPDSImporterSettings(
"assume the books have this target audience."
),
type=ConfigurationFormItemType.SELECT,
format="narrow",
options={_NO_DEFAULT_AUDIENCE: _("No default audience")}.update(
{audience: audience for audience in sorted(Classifier.AUDIENCES)}
),
options={
**{_NO_DEFAULT_AUDIENCE: _("No default audience")},
**{audience: audience for audience in sorted(Classifier.AUDIENCES)},
},
required=False,
),
)
Expand Down
1 change: 0 additions & 1 deletion tests/api/admin/controller/test_patron_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def test_patron_auth_services_get_with_no_services(
protocols = response.get("protocols")
assert isinstance(protocols, list)
assert 7 == len(protocols)
assert SimpleAuthenticationProvider.__module__ == protocols[0].get("name")
assert "settings" in protocols[0]
assert "library_settings" in protocols[0]

Expand Down

0 comments on commit eafb469

Please sign in to comment.