def get_field_on_block(block, field_name, default_value=None):
 try:
  if block.fields[field_name].is_set_on(block):
   return getattr(block, field_name)
 except KeyError:
  pass
 return default_value

def get_field_on_block ( block , field_name , default_value = None ) : try : if block . fields [ field_name ] . is_set_on ( block ) : return getattr ( block , field_name ) except KeyError : pass return default_value
get the field value that is directly set on the xblock .