Blame action/action.py

Ivan Mahonin b838e2
Ivan Mahonin b838e2
Ivan Mahonin b838e2
import exception
Ivan Mahonin b838e2
Ivan Mahonin b838e2
class Action:
Ivan Mahonin b838e2
  def __init__(self):
Ivan Mahonin b838e2
    self.readonly = False
Ivan Mahonin b838e2
  
Ivan Mahonin b838e2
  def process(self, request):
Ivan Mahonin b838e2
    assert False
Ivan Mahonin b838e2
    
Ivan Mahonin b838e2
  def propagate_exception(self, e):
Ivan Mahonin b838e2
    if type(e) is exception.ModelWrongData:
Ivan Mahonin b838e2
      raise exception.ActionError(e.messages)
Ivan Mahonin b838e2
    if type(e) is exception.ModelDeny:
Ivan Mahonin b838e2
      raise exception.HttpForbidden()
Ivan Mahonin b838e2
    raise e
Ivan Mahonin b838e2
Ivan Mahonin b838e2