8000 fix: Missing docstrings for cms_perms decorated functions e.g. in dja… · django-cms/django-cms@c30efd4 · GitHub
[go: up one dir, main page]

Skip to content

Commit c30efd4

Browse files
fsbraunvinitkumar
andauthored
fix: Missing docstrings for cms_perms decorated functions e.g. in django.admin.admindocs (#8179)
* fix: Missing docstrings for cms_perms decorator * fix ruff issues * Update docs.yml --------- Co-authored-by: Vinit Kumar <mail@vinitkumar.me>
1 parent 888ee6e commit c30efd4

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Python
1717
uses: actions/setup-python@v5
1818
with:
19-
python-version: "3.12"
19+
python-version: "3.11"
2020
cache: 'pip'
2121
- name: Cache dependencies
2222
uses: actions/cache@v4

cms/utils/decorators.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ def inner(request, *args, **kwargs):
2727
elif hasattr(func, '__class__'):
2828
inner.__name__ = func.__class__.__name__
2929

30+
# for django.contrib.admindoc
31+
if hasattr(func, '__qualname__'):
32+
inner.__qualname__ = func.__qualname__
33+
elif hasattr(func, '__class__') and hasattr(func.__class__, '__qualname__'):
34+
inner.__qualname__ = func.__class__.__qualname__
35+
3036
if getattr(func, 'csrf_exempt', False):
3137
# view has set csrf_exempt flag
3238
# so pass it down to the decorator.

0 commit comments

Comments
 (0)
0