utils: apply mapping to custom attributes before static ones (#27044)
It's impossible to set a verified first_name or last_name without it.
This commit is contained in:
parent
fa9c460eed
commit
dd43c144c5
|
@ -151,11 +151,6 @@ def apply_user_info_mappings(user, user_info):
|
|||
continue
|
||||
save_user = True
|
||||
user.set_password(value)
|
||||
elif hasattr(user, attribute):
|
||||
save_user = True
|
||||
if mapping.get('if-empty') and getattr(user, attribute):
|
||||
continue
|
||||
setattr(user, attribute, value)
|
||||
elif hasattr(user.attributes, attribute):
|
||||
if mapping.get('if-empty') and getattr(user.attributes, attribute):
|
||||
continue
|
||||
|
@ -163,6 +158,11 @@ def apply_user_info_mappings(user, user_info):
|
|||
setattr(user.verified_attributes, attribute, value)
|
||||
else:
|
||||
setattr(user.attributes, attribute, value)
|
||||
elif hasattr(user, attribute):
|
||||
save_user = True
|
||||
if mapping.get('if-empty') and getattr(user, attribute):
|
||||
continue
|
||||
setattr(user, attribute, value)
|
||||
else:
|
||||
logger.warning(u'auth_fc: unknown attribute in user_info mapping: %s', attribute)
|
||||
continue
|
||||
|
|
Reference in New Issue