Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Use get_identity_attributes instead of email in role commands #809

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion flask_security/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def __init__(self, user_model, role_model):

def _prepare_role_modify_args(self, user, role):
if isinstance(user, string_types):
user = self.find_user(email=user)
identity_attr = get_identity_attributes()[0]
user = self.find_user(**{identity_attr: user})
if isinstance(role, string_types):
role = self.find_role(role)
return user, role
Expand Down