diff options
| author | BrickXu | 2014-12-05 13:30:56 +0800 |
|---|---|---|
| committer | BrickXu | 2014-12-05 13:30:56 +0800 |
| commit | 4042180392fb7809d1c8d2f6ca0bc6e18c114e6c (patch) | |
| tree | 5fab017db281948eecf54d9dd8d5f0a8b323fa77 /rest_framework/viewsets.py | |
| parent | 81870b6e1a7b0c3c149d4bfba0e20924ebf1b187 (diff) | |
| parent | e8cbf41bd9066a21bf102bb60fbb42b4b15e05f6 (diff) | |
| download | django-rest-framework-4042180392fb7809d1c8d2f6ca0bc6e18c114e6c.tar.bz2 | |
Merge pull request #3 from tomchristie/master
Merge upstream
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: |
