title: Action is sometimes None in Django REST framework
body: <p>I have written a customized permission class in Django REST Framework version 3.8.2 that behaves differently depending on the action of the request. I found that sometimes <code>view.action</code> is <code>None</code> when using the Browsable API to debug. Below follows a piece of code that will throw an exception when used with the Browsable API.</p>
  
  <pre class="lang-py prettyprint-override"><code>class AdminOnlyPermission(BasePermission):
  
      def has_permission(self, request, view):
  
          # Just to demonstrate that view.action can be None
          assert(view.action is not None)
  
          # Only allow admin to delete
          if view.action == 'delete' and not request.user.is_staff:
              return False
  
          return True
  </code></pre>
  
  <p>What does it mean that <code>view.action</code> is <code>None</code>? Can I safely ignore it or is it possible for a malicious user to make a delete request with the action set to <code>None</code>?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>The permission class is only used for <code>GenericViewSets</code>.</p>