  from django.views.decorators.csrf import csrf_exempt
  
  from rest_framework import generics, mixins, views
  from rest_framework.reverse import reverse
  
  
  def _is_extra_action(attr):
      return hasattr(attr, 'mapping') and isinstance(attr.mapping, MethodMapper)
  
 
</s> remove     return hasattr(attr, 'mapping')
 </s> add     return hasattr(attr, 'mapping') and isinstance(attr.mapping, MethodMapper)
from rest_framework.decorators import MethodMapper
  from django.views.decorators.csrf import csrf_exempt
  
  from rest_framework import generics, mixins, views
from rest_framework.decorators import MethodMapper
  from rest_framework.reverse import reverse
  
  
  def _is_extra_action(attr):
      return hasattr(attr, 'mapping') and isinstance(attr.mapping, MethodMapper)
  
keep keep add keep keep keep keep keep keep
 Extra action detection is too permissive. Add failing test + fix (#7217)

* Add failing test

* Add failing test++

* Make get_extra_action less permissive 
rest_framework/viewsets.py