Skip to content

Bug in linkcheck_suggest_config #206

Open
@frankwiles

Description

@frankwiles

Hello! Client of ours wanted to start using this app and I found a small bug that is super confusing to a first time user.

If I run:

$ ./manage.py linkcheck_suggest_config --model matrix.JobTitle > matrix/example.py

With a model that looks like this:

class JobTitle(models.Model):
    # ... misc fields ...
   url = models.URLField("URL", blank=True, null=True)
   # ... other fields ...

I get a suggestion that looks like this:

from matrix.models import JobTitle

class JobTitleLinklist(Linklist):
    model = JobTitle
    url_fields = [matrix.JobTitle.logo]                                                                                                                                                                 ignore_empty = [matrix.JobTitle.logo]
    object_filter = {"active": True}

linklists = {
    "JobTitle": JobTitleLinklist,
}

Which is CLOSE but not quite right. It's:

  • missing the from linkcheck import Linklist import
  • the fields actually need to just be the string "logo"

For it to actually work.

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