Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused base_views.get_view_description() #896

Merged
merged 2 commits into from
Jul 16, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions galaxy/api/views/base_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe

from rest_framework.authentication import get_authorization_header
from rest_framework.exceptions import PermissionDenied
Expand Down Expand Up @@ -63,26 +62,6 @@ def get_view_name(cls, suffix=None):
return views.get_view_name(cls, suffix=None)


def get_view_description(cls, html=False):
"""
Wrapper around REST framework get_view_description() to support
get_description() method and view_description property on a view class.
"""
if hasattr(cls, 'get_description') and callable(cls.get_description):
desc = cls().get_description(html=html)
cls = type(cls.__name__, (object,), {'__doc__': desc})
elif hasattr(cls, 'view_description'):
if callable(cls.view_description):
view_desc = cls.view_description()
else:
view_desc = cls.view_description
cls = type(cls.__name__, (object,), {'__doc__': view_desc})
desc = views.get_view_description(cls, html=html)
if html:
desc = '<div class="description">%s</div>' % desc
return mark_safe(desc)


class APIView(views.APIView):

def get_authenticate_header(self, request):
Expand Down