title: Django Add messages.error message to FormView
body: <p>I need to show an error message after form submission to the user. The condition is set inside the <code>form_valid</code> function of <code>FormView</code> but it is not form specific and I do not want to change the existing form logic. This is what I have tried -</p>
  <pre><code>def form_valid(self, form):
      ...
      if condition:
          messages.error(self.request, 'Please ...')
      return super(...)
  </code></pre>
  <p>Also tried this -</p>
  <pre><code>def form_valid(self, form):
      ...
      if condition:
          self.message = 'Please ...'
      return super(...)
  
  def get_success_url(self):
      if self.message:
          messages.add_message(self.request, messages.ERROR, self.message)
      return self.success_url
  </code></pre>
  <p>Both of them don't work. In <code>DeleteView</code> this can be done by overriding <code>delete</code> function, how to do it for <code>FormView</code>?</p>