def push_status_message(message, kind='warning', dismissible=True, trust=True, jumbotron=False):
 try:
  statuses = session.data.get('status')
 except RuntimeError as e:
  exception_message = getattr(e, 'message', None)
  if (exception_message == 'working outside of request context'):
   if (kind == 'error'):
    from rest_framework.exceptions import ValidationError
    raise ValidationError(message)
   return
  else:
   raise
 if (not statuses):
  statuses = []
 css_class = TYPE_MAP.get(kind, 'warning')
 statuses.append(Status(message=message, jumbotron=jumbotron, css_class=css_class, dismissible=dismissible, trust=trust))
 session.data['status'] = statuses

def push_status_message ( message , kind = 'warning' , dismissible = True , trust = True , jumbotron = False ) : try : statuses = session . data . get ( 'status' ) except RuntimeError as e : exception_message = getattr ( e , 'message' , None ) if ( exception_message == 'working outside of request context' ) : if ( kind == 'error' ) : from rest_framework . exceptions import ValidationError raise ValidationError ( message ) return else : raise if ( not statuses ) : statuses = [ ] css_class = TYPE_MAP . get ( kind , 'warning' ) statuses . append ( Status ( message = message , jumbotron = jumbotron , css_class = css_class , dismissible = dismissible , trust = trust ) ) session . data [ 'status' ] = statuses
push a status message that will be displayed as a banner on the next page loaded by the user .