summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorKent Shikama <kent@kentshikama.com>2016-07-04 22:00:13 +0900
committerKent Shikama <kent@kentshikama.com>2016-07-04 22:00:13 +0900
commit2e5a31f1973b49ec1a89cfc042e00b51ba7e70fc (patch)
tree130779cf93903b3ec3a3d661ff42a62bde430c33 /synapse
parentOptionally include password hash in createUser endpoint (diff)
downloadsynapse-2e5a31f1973b49ec1a89cfc042e00b51ba7e70fc.tar.xz
Use .get() instead of [] to access password_hash
Diffstat (limited to 'synapse')
-rw-r--r--synapse/rest/client/v1/register.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/register.py b/synapse/rest/client/v1/register.py
index ef56d1e90f..a923d5a198 100644
--- a/synapse/rest/client/v1/register.py
+++ b/synapse/rest/client/v1/register.py
@@ -410,7 +410,7 @@ class CreateUserRestServlet(ClientV1RestServlet):
             raise SynapseError(400, "Failed to parse 'duration_seconds'")
         if duration_seconds > self.direct_user_creation_max_duration:
             duration_seconds = self.direct_user_creation_max_duration
-        password_hash = user_json["password_hash"].encode("utf-8") if user_json["password_hash"] else None
+        password_hash = user_json["password_hash"].encode("utf-8") if user_json.get("password_hash") else None
 
         handler = self.handlers.registration_handler
         user_id, token = yield handler.get_or_create_user(