code: def get_next_action(self, request, application, roles):
          
  
          # Check for serious errors in submission.
          # Should only happen in rare circumstances.
          errors = application.check_valid()
          if len(errors) > 0:
              for error in errors:
                  messages.error(request, error)
              return 'error'
  
          # mark as submitted
          application.submit()
  
          return 'success'
docs: Retrieve the next state.