8000 fix: Grouper admin raised AttributeError when used outside the admin views by fsbraun · Pull Request #8067 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

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

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

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.

@fsbraun fsbraun added the 5.0 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
fsbraun added a commit that referenced this pull request Jun 28, 2025
…views (#8067)

* Fix: GrouperModelAdmin raised an AttributeError if used outside the admin app

* Fixed: Page.__str__ returns page title with admin_manager

* feat: Format `Page.__str__` as "My title (/path/to/page/)"

* Update tests for new str method of Page

* Simplify str

---------

Co-authored-by: Github Release Action <info@django-cms.org>
Co-authored-by: Vinit Kumar <mail@vinitkumar.me>
fsbraun added a commit that referenced this pull request Jun 28, 2025
…views (#8067)

* Fix: GrouperModelAdmin raised an AttributeError if used outside the admin app

* Fixed: Page.__str__ returns page title with admin_manager

* feat: Format `Page.__str__` as "My title (/path/to/page/)"

* Update tests for new str method of Page

* Simplify str

---------

Co-authored-by: Github Release Action <info@django-cms.org>
Co-authored-by: Vinit Kumar <mail@vinitkumar.me>
fsbraun added a commit that referenced this pull request Jun 28, 2025
* fix: Wizard pool depr message

* fix: Add hash method to FizzyInt for testing

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

* Fix: GrouperModelAdmin raised an AttributeError if used outside the admin app

* Fixed: Page.__str__ returns page title with admin_manager

* feat: Format `Page.__str__` as "My title (/path/to/page/)"

* Update tests for new str method of Page

* Simplify str

---------

Co-authored-by: Github Release Action <info@django-cms.org>
Co-authored-by: Vinit Kumar <mail@vinitkumar.me>

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

* Fix: GrouperModelAdmin raised an AttributeError if used outside the admin app

* Fixed: Page.__str__ returns page title with admin_manager

* feat: Format `Page.__str__` as "My title (/path/to/page/)"

* Update tests for new str method of Page

* Simplify str

---------

Co-authored-by: Github Release Action <info@django-cms.org>
Co-authored-by: Vinit Kumar <mail@vinitkumar.me>

* Fix linting error

* Update node dependencies

* Add missing import

---------

Co-authored-by: Github Release Action <info@django-cms.org>
Co-authored-by: Vinit Kumar <mail@vinitkumar.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 needs to be backported Commits need to be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0