﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26632	System check for list_display_links ignores value of ModelAdmin.get_list_display()	Zach Borboa	nobody	"The list_display_links system check should also look at the values returned by ModelAdmin.get_list_display() before displaying error (admin.E111).

{{{#!python
# models
from django.db import models

class Question(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')
}}}

{{{#!python
# admin
from django.contrib import admin
from .models import Question

class QuestionAdmin(admin.ModelAdmin):
    # list_display = ['id', 'pub_date', 'question_text']
    list_display_links = ['id', 'pub_date', 'question_text',]

    def get_list_display(self, request):
        return ['id', 'pub_date', 'question_text']

admin.site.register(Question, QuestionAdmin)
}}}

{{{
$ python manage.py check
SystemCheckError: System check identified some issues:

ERRORS:
<class 'myapp.admin.QuestionAdmin'>: (admin.E111) The value of 'list_display_links[0]' refers to 'id', which is not defined in 'list_display'.
<class 'myapp.admin.QuestionAdmin'>: (admin.E111) The value of 'list_display_links[1]' refers to 'pub_date', which is not defined in 'list_display'.
<class 'myapp.admin.QuestionAdmin'>: (admin.E111) The value of 'list_display_links[2]' refers to 'question_text', which is not defined in 'list_display'.
}}}"	Bug	closed	contrib.admin	dev	Normal	fixed		desecho@…	Accepted	1	0	0	0	0	0
