Remove rest framework deprecated decorators

remotes/origin/issue/4795/notification_even_they_are_disabled
Jesús Espino 2016-02-10 19:45:34 +01:00
parent 7df6450fae
commit e43ea107ed
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
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import warnings
# Rest Framework 2.4 backport some decorators.
@ -44,37 +42,3 @@ def list_route(methods=['get'], **kwargs):
func.kwargs = kwargs
return func
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