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

fix: Grouper admin raised AttributeError when used outside the admin views #8067

Merged
merged 6 commits into from
Nov 6, 2024

Conversation

fsbraun
Copy link
Member

@fsbraun fsbraun commented Nov 6, 2024

Description

This PR adds fallback methods to GrouperModelAdmin to allow for fallback methods if not all grouping fields are set. This allows to use GrouperModelAdmin outside the admin views, e.g., as a target for the AutocompleteSelect widget.

It makes pages searchable by adding search fields. Also, the page's str method is updated for search fields: This way pages are consistently represented in the admin by (str(page)) in the form of "My page title (/path/to/page)" in the current or a fallback language.

Finally, a type hint error is fixed.

Related resources

  • #...
  • #...

Checklist

  • I have opened this pull request against develop-4
  • I have added or modified the tests when changing logic
  • I have followed the conventional commits guidelines to add meaningful information into the changelog
  • I have read the contribution guidelines and I have joined the channel #pr-reviews on our Discord Server to find a “pr review buddy” who is going to review my pull request.

cms/admin/pageadmin.py Show resolved Hide resolved
cms/models/pagemodel.py Show resolved Hide resolved
@fsbraun fsbraun added the 4.2 label Nov 6, 2024
@fsbraun fsbraun merged commit e1af998 into django-cms:develop-4 Nov 6, 2024
51 checks passed
@fsbraun fsbraun deleted the fix/grouper-admin branch November 6, 2024 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.2 needs to be backported Commits need to be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants