mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #24979 -- Removed usage of inspect.getargspec().
This commit is contained in:
@@ -14,6 +14,7 @@ from django.db import models
|
||||
from django.http import Http404
|
||||
from django.template.engine import Engine
|
||||
from django.utils.decorators import method_decorator
|
||||
from django.utils.inspect import func_has_no_args
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
@@ -243,7 +244,7 @@ class ModelDetailView(BaseAdminDocsView):
|
||||
|
||||
# Gather model methods.
|
||||
for func_name, func in model.__dict__.items():
|
||||
if (inspect.isfunction(func) and len(inspect.getargspec(func)[0]) == 1):
|
||||
if inspect.isfunction(func) and func_has_no_args(func):
|
||||
try:
|
||||
for exclude in MODEL_METHODS_EXCLUDE:
|
||||
if func_name.startswith(exclude):
|
||||
|
||||
Reference in New Issue
Block a user