def user_details(strategy, details, user=None, *args, **kwargs):
 if user:
  changed = False
  protected = (('username', 'id', 'pk', 'email') + tuple(strategy.setting('PROTECTED_USER_FIELDS', [])))
  for (name, value) in details.items():
   if (not hasattr(user, name)):
    continue
   current_value = getattr(user, name, None)
   if ((not current_value) or (name not in protected)):
    changed |= (current_value != value)
    setattr(user, name, value)
  if changed:
   strategy.storage.user.changed(user)

def user_details ( strategy , details , user = None , * args , ** kwargs ) : if user : changed = False protected = ( ( 'username' , 'id' , 'pk' , 'email' ) + tuple ( strategy . setting ( 'PROTECTED_USER_FIELDS' , [ ] ) ) ) for ( name , value ) in details . items ( ) : if ( not hasattr ( user , name ) ) : continue current_value = getattr ( user , name , None ) if ( ( not current_value ) or ( name not in protected ) ) : changed |= ( current_value != value ) setattr ( user , name , value ) if changed : strategy . storage . user . changed ( user )
update user details using data from provider .