
"""Handlers for request specific columns."""

from ggrc.converters.handlers import handlers
from ggrc.converters import errors


class RequestStatusColumnHandler(handlers.StatusColumnHandler):
  """Handler for request status."""

  def parse_item(self):
    """Parse raw_value into a valid request status if possible."""
    value = handlers.StatusColumnHandler.parse_item(self)
    if value in {"Final", "Verified"}:
      value = "In Progress"
      self.add_warning(errors.REQUEST_INVALID_STATE)
    return value


"""Handlers for request specific columns."""

from ggrc.converters.handlers import handlers
from ggrc.converters import errors
from ggrc import models


class RequestStatusColumnHandler(handlers.StatusColumnHandler):
  """Handler for request status."""

  def parse_item(self):
    """Parse raw_value into a valid request status if possible."""
    value = handlers.StatusColumnHandler.parse_item(self)
    if value in models.Request.END_STATES:
      value = models.Request.PROGRESS_STATE
      self.add_warning(errors.REQUEST_INVALID_STATE)
    return value

Update Request object import to use statusable attributes
Update Request object import to use statusable attributes

  
  """Handlers for request specific columns."""
  
  from ggrc.converters.handlers import handlers
  from ggrc.converters import errors
+ from ggrc import models
  
  
  class RequestStatusColumnHandler(handlers.StatusColumnHandler):
    """Handler for request status."""
  
    def parse_item(self):
      """Parse raw_value into a valid request status if possible."""
      value = handlers.StatusColumnHandler.parse_item(self)
-     if value in {"Final", "Verified"}:
-       value = "In Progress"
+     if value in models.Request.END_STATES:
+       value = models.Request.PROGRESS_STATE
        self.add_warning(errors.REQUEST_INVALID_STATE)
      return value
  
Update Request object import to use statusable attributes
## Code Before:

"""Handlers for request specific columns."""

from ggrc.converters.handlers import handlers
from ggrc.converters import errors


class RequestStatusColumnHandler(handlers.StatusColumnHandler):
  """Handler for request status."""

  def parse_item(self):
    """Parse raw_value into a valid request status if possible."""
    value = handlers.StatusColumnHandler.parse_item(self)
    if value in {"Final", "Verified"}:
      value = "In Progress"
      self.add_warning(errors.REQUEST_INVALID_STATE)
    return value

## Instruction:
Update Request object import to use statusable attributes
## Code After:

"""Handlers for request specific columns."""

from ggrc.converters.handlers import handlers
from ggrc.converters import errors
from ggrc import models


class RequestStatusColumnHandler(handlers.StatusColumnHandler):
  """Handler for request status."""

  def parse_item(self):
    """Parse raw_value into a valid request status if possible."""
    value = handlers.StatusColumnHandler.parse_item(self)
    if value in models.Request.END_STATES:
      value = models.Request.PROGRESS_STATE
      self.add_warning(errors.REQUEST_INVALID_STATE)
    return value
