diff options
Diffstat (limited to 'rest_framework/viewsets.py')
| -rw-r--r-- | rest_framework/viewsets.py | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/rest_framework/viewsets.py b/rest_framework/viewsets.py index 84b4bd8d..70d14695 100644 --- a/rest_framework/viewsets.py +++ b/rest_framework/viewsets.py @@ -48,6 +48,12 @@ class ViewSetMixin(object):          # eg. 'List' or 'Instance'.          cls.suffix = None +        # actions must not be empty +        if not actions: +            raise TypeError("The `actions` argument must be provided when " +                            "calling `.as_view()` on a ViewSet. For example " +                            "`.as_view({'get': 'list'})`") +          # sanitize keyword arguments          for key in initkwargs:              if key in cls.http_method_names: | 
