summary refs log tree commit diff
path: root/synapse/rest/client
diff options
context:
space:
mode:
authorpik <alexander.maznev@gmail.com>2016-10-18 12:17:38 -0500
committerpik <alexander.maznev@gmail.com>2016-10-18 12:17:38 -0500
commite8b1d2a45200d88a576360a83e3dff1aac4ad679 (patch)
tree65093b143547c44795535ac39edfac36d39394d9 /synapse/rest/client
parentFix MockHttpRequest always returning M_UNKNOWN errcode in testing (diff)
downloadsynapse-e8b1d2a45200d88a576360a83e3dff1aac4ad679.tar.xz
Refactor test_filter to use real DataStore
 * add tests for filter api errors
Diffstat (limited to 'synapse/rest/client')
-rw-r--r--synapse/rest/client/v2_alpha/filter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/rest/client/v2_alpha/filter.py b/synapse/rest/client/v2_alpha/filter.py
index f7758fc68c..b4084fec62 100644
--- a/synapse/rest/client/v2_alpha/filter.py
+++ b/synapse/rest/client/v2_alpha/filter.py
@@ -74,6 +74,7 @@ class CreateFilterRestServlet(RestServlet):
 
     @defer.inlineCallbacks
     def on_POST(self, request, user_id):
+
         target_user = UserID.from_string(user_id)
         requester = yield self.auth.get_user_by_req(request)
 
@@ -81,10 +82,9 @@ class CreateFilterRestServlet(RestServlet):
             raise AuthError(403, "Cannot create filters for other users")
 
         if not self.hs.is_mine(target_user):
-            raise SynapseError(400, "Can only create filters for local users")
+            raise AuthError(403, "Can only create filters for local users")
 
         content = parse_json_object_from_request(request)
-
         filter_id = yield self.filtering.add_user_filter(
             user_localpart=target_user.localpart,
             user_filter=content,