code: def _add_default_exposure_class(layer):
      
      layer.startEditing()
  
      field = create_field_from_definition(exposure_class_field)
      layer.keywords['inasafe_fields'][exposure_class_field['key']] = (
          exposure_class_field['field_name'])
      layer.addAttribute(field)
  
      index = layer.fields().lookupField(exposure_class_field['field_name'])
  
      exposure = layer.keywords['exposure']
  
      request = QgsFeatureRequest()
      request.setFlags(QgsFeatureRequest.NoGeometry)
      for feature in layer.getFeatures(request):
          layer.changeAttributeValue(feature.id(), index, exposure)
  
      layer.commitChanges()
      return
docs: The layer doesn't have an exposure class, we need to add it.
  
      :param layer: The vector layer.
      :type layer: QgsVectorLayer