Skip to content

Commit fec50aa

Browse files
committed
Fix missing tree breaking new user emails in multi-tree setups (fixes #603)
1 parent 28b99b1 commit fec50aa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gramps_webapi/api/resources/user.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,14 +557,17 @@ def get(self):
557557
# This is a wrong token!
558558
abort_with_message(403, "Wrong token")
559559
current_details = get_user_details(username)
560+
assert current_details is not None # for type checker
560561
# the email is stored in the JWT
561562
if claims["email"] != current_details.get("email"):
562563
# This is a wrong token!
563564
abort_with_message(403, "Wrong token")
564565
if current_details["role"] == ROLE_UNCONFIRMED:
565566
# otherwise it has been confirmed already
566567
modify_user(name=username, role=ROLE_DISABLED)
567-
tree = get_tree_from_jwt()
568+
# we cannot use get_tree_from_jwt here since the JWT does not
569+
# contain the tree ID
570+
tree = get_tree_id(user_id)
568571
is_multi = current_app.config["TREE"] == TREE_MULTI
569572
run_task(
570573
send_email_new_user,

0 commit comments

Comments
 (0)