def update_user(userid=""): """ PUT /collection creates new collection """ new_stuff = request.json try: key = new_stuff["key"] except KeyError: abort(400, "the submitted user object is missing required properties.") try: res = UserFactory.put(new_stuff, key, mydao) except NotAuthenticatedError: abort(403, "You've got the wrong password.") except AttributeError: abort(400, "the submitted user object is missing required properties.") resp = make_response(json.dumps(res, indent=4), 200) resp.mimetype = "application/json" return resp