def user_password_not_empty(key, data, errors, context):
 if ((data.get(('password_hash',), missing) is not missing) and authz.is_sysadmin(context.get('user'))):
  return
 if ((not (('password1',) in data)) and (not (('password2',) in data))):
  password = data.get(('password',), None)
  if (not password):
   errors[key].append(_('Missing value'))

def user_password_not_empty ( key , data , errors , context ) : if ( ( data . get ( ( 'password_hash' , ) , missing ) is not missing ) and authz . is_sysadmin ( context . get ( 'user' ) ) ) : return if ( ( not ( ( 'password1' , ) in data ) ) and ( not ( ( 'password2' , ) in data ) ) ) : password = data . get ( ( 'password' , ) , None ) if ( not password ) : errors [ key ] . append ( _ ( 'Missing value' ) )
only check if password is present if the user is created via action api .