diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2019-09-03 21:03:22 +0100 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2019-09-03 21:03:22 +0100 |
commit | 83021d9b607411c459497154883fdba38946f542 (patch) | |
tree | 6fcafc7c6ffb2b57a985291702cdef8a9e31bb77 | |
parent | use v2 identity service api endpoints for 3pid invites and lookup (diff) | |
parent | Ensure the list media admin API is always available (#5966) (diff) | |
download | synapse-83021d9b607411c459497154883fdba38946f542.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into anoa/v2_lookup
-rw-r--r-- | changelog.d/5966.bugfix | 1 | ||||
-rw-r--r-- | synapse/rest/admin/__init__.py | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/changelog.d/5966.bugfix b/changelog.d/5966.bugfix new file mode 100644 index 0000000000..b8ef5a7819 --- /dev/null +++ b/changelog.d/5966.bugfix @@ -0,0 +1 @@ +Fix admin API for listing media in a room not being available with an external media repo. diff --git a/synapse/rest/admin/__init__.py b/synapse/rest/admin/__init__.py index b4761adaed..81b6bd8816 100644 --- a/synapse/rest/admin/__init__.py +++ b/synapse/rest/admin/__init__.py @@ -41,7 +41,7 @@ from synapse.rest.admin._base import ( assert_user_is_admin, historical_admin_path_patterns, ) -from synapse.rest.admin.media import register_servlets_for_media_repo +from synapse.rest.admin.media import ListMediaInRoom, register_servlets_for_media_repo from synapse.rest.admin.purge_room_servlet import PurgeRoomServlet from synapse.rest.admin.server_notice_servlet import SendServerNoticeServlet from synapse.rest.admin.users import UserAdminServlet @@ -761,9 +761,12 @@ def register_servlets_for_client_rest_resource(hs, http_server): DeleteGroupAdminRestServlet(hs).register(http_server) AccountValidityRenewServlet(hs).register(http_server) - # Load the media repo ones if we're using them. + # Load the media repo ones if we're using them. Otherwise load the servlets which + # don't need a media repo (typically readonly admin APIs). if hs.config.can_load_media_repo: register_servlets_for_media_repo(hs, http_server) + else: + ListMediaInRoom(hs).register(http_server) # don't add more things here: new servlets should only be exposed on # /_synapse/admin so should not go here. Instead register them in AdminRestResource. |