Merge pull request #617 from taigaio/removed-rest-framework-deprecated-decorators

Remove rest framework deprecated decorators
remotes/origin/issue/4795/notification_even_they_are_disabled
David Barragán Merino 2016-02-10 20:19:11 +01:00
commit e26f3d1657
1 changed files with 0 additions and 36 deletions

View File

@ -15,8 +15,6 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
import warnings
# Rest Framework 2.4 backport some decorators. # Rest Framework 2.4 backport some decorators.
@ -44,37 +42,3 @@ def list_route(methods=['get'], **kwargs):
func.kwargs = kwargs func.kwargs = kwargs
return func return func
return decorator return decorator
def link(**kwargs):
"""
Used to mark a method on a ViewSet that should be routed for detail GET requests.
"""
msg = 'link is pending deprecation. Use detail_route instead.'
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
def decorator(func):
func.bind_to_methods = ['get']
func.detail = True
func.permission_classes = kwargs.get('permission_classes', [])
func.kwargs = kwargs
return func
return decorator
def action(methods=['post'], **kwargs):
"""
Used to mark a method on a ViewSet that should be routed for detail POST requests.
"""
msg = 'action is pending deprecation. Use detail_route instead.'
warnings.warn(msg, PendingDeprecationWarning, stacklevel=2)
def decorator(func):
func.bind_to_methods = methods
func.detail = True
func.permission_classes = kwargs.get('permission_classes', [])
func.kwargs = kwargs
return func
return decorator