summary refs log tree commit diff
diff options
context:
space:
mode:
authorH. Shay <hillerys@element.io>2023-05-10 08:53:35 -0700
committerH. Shay <hillerys@element.io>2023-05-10 08:53:35 -0700
commitaea7cbd48c623057427b56583d7afc12a691ee46 (patch)
tree3a6209296f3db5000aac2f4c6452ab6e822a599f
parentremove support for per-user msc2654 (diff)
downloadsynapse-aea7cbd48c623057427b56583d7afc12a691ee46.tar.xz
move ExperimentalFeature definition to avoid circular import
-rw-r--r--synapse/rest/admin/experimental_features.py13
-rw-r--r--synapse/storage/databases/main/experimental_features.py12
2 files changed, 12 insertions, 13 deletions
diff --git a/synapse/rest/admin/experimental_features.py b/synapse/rest/admin/experimental_features.py
index 1d409ac2b7..8b07e1dff6 100644
--- a/synapse/rest/admin/experimental_features.py
+++ b/synapse/rest/admin/experimental_features.py
@@ -13,7 +13,6 @@
 #  limitations under the License.
 
 
-from enum import Enum
 from http import HTTPStatus
 from typing import TYPE_CHECKING, Dict, Tuple
 
@@ -21,23 +20,13 @@ from synapse.api.errors import SynapseError
 from synapse.http.servlet import RestServlet, parse_json_object_from_request
 from synapse.http.site import SynapseRequest
 from synapse.rest.admin import admin_patterns, assert_requester_is_admin
+from synapse.storage.databases.main.experimental_features import ExperimentalFeature
 from synapse.types import JsonDict, UserID
 
 if TYPE_CHECKING:
     from synapse.server import HomeServer
 
 
-class ExperimentalFeature(str, Enum):
-    """
-    Currently supported per-user features
-    """
-
-    MSC3026 = "msc3026"
-    MSC2654 = "msc2654"
-    MSC3881 = "msc3881"
-    MSC3967 = "msc3967"
-
-
 class ExperimentalFeaturesRestServlet(RestServlet):
     """
     Enable or disable experimental features for a user or determine which features are enabled
diff --git a/synapse/storage/databases/main/experimental_features.py b/synapse/storage/databases/main/experimental_features.py
index 5e11295bd3..197cdb21ce 100644
--- a/synapse/storage/databases/main/experimental_features.py
+++ b/synapse/storage/databases/main/experimental_features.py
@@ -12,6 +12,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
+from enum import Enum
 from typing import TYPE_CHECKING, Dict
 
 from synapse.storage.database import DatabasePool, LoggingDatabaseConnection
@@ -20,10 +21,19 @@ from synapse.types import StrCollection
 from synapse.util.caches.descriptors import cached
 
 if TYPE_CHECKING:
-    from synapse.rest.admin.experimental_features import ExperimentalFeature
     from synapse.server import HomeServer
 
 
+class ExperimentalFeature(str, Enum):
+    """
+    Currently supported per-user features
+    """
+
+    MSC3026 = "msc3026"
+    MSC2654 = "msc2654"
+    MSC3881 = "msc3881"
+    MSC3967 = "msc3967"
+
 class ExperimentalFeaturesStore(CacheInvalidationWorkerStore):
     def __init__(
         self,