8000 [BUG] CMSApp without a name raises misleading error · Issue #8055 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content
[BUG] CMSApp without a name raises misleading error #8055
Closed
@halitcelik

Description

@halitcelik

Description

If a CMSApp is registered without a name we get an error saying "< is not supported between str and NoneType" which is kind of misleading and not very helpful.
This is in apphook_pool we have a sorted function that sorts registered CMSApps with their names. I was wondering if we could fall back to class name, raise an error with another message or just leave it as it is.

Steps to reproduce

  1. Register a CMSApp without name
  2. Runserver

Expected behaviour

Either a fallback to class name or an error message indicating the "ClassName is missing a name"

Actual behaviour

An error saying "< is not supported between str and NoneType" is raised.
This is in apphooks_pool.py line 82:

hooks = sorted(hooks, key=lambda hook: hook[1])

Where we try to sort the registered apps with their names but one or more has None as name.

Do you want to help fix this issue?

  • Yes, I want to help fix this issue and I will join the channel #pr-reviews on the Discord Server to confirm with the community that a PR is welcome.
  • No, I only want to report the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0