Browse Source

Use functools

Co-Authored-By: Erik Johnston <erik@matrix.org>
David Baker 4 years ago
parent
commit
19e3ffbfbf
1 changed files with 2 additions and 1 deletions
  1. 2 1
      sydent/http/servlets/__init__.py

+ 2 - 1
sydent/http/servlets/__init__.py

@@ -86,7 +86,8 @@ def get_args(request, required_args):
         if a not in args:
             missing.append(a)
 
-    if len(missing) > 0:
+    @functools.wraps(f)
+    def inner(*args, **kwargs):
         request.setResponseCode(400)
         msg = "Missing parameters: "+(",".join(missing))
         raise MatrixRestError(400, 'M_MISSING_PARAMS', msg)