Skip to content

Commit aa1bf7a

Browse files
authored
Merge pull request #7028 from readthedocs/build-admin-cleanup
Clean up build admin to make list display match search
2 parents 052ae5d + ed70bba commit aa1bf7a

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

readthedocs/builds/admin.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,22 @@ class BuildAdmin(admin.ModelAdmin):
6161
'state',
6262
'error',
6363
'success',
64-
'length',
6564
'cold_storage',
65+
'date',
66+
'builder',
67+
'length',
6668
'pretty_config',
6769
)
6870
readonly_fields = (
71+
'date', # required to be read-only because it's a @property
6972
'pretty_config', # required to be read-only because it's a @property
7073
'builder',
74+
'length',
7175
)
7276
list_display = (
7377
'id',
74-
'project',
75-
'version_name',
78+
'project_slug',
79+
'version_slug',
7680
'success',
7781
'type',
7882
'state',
@@ -86,8 +90,11 @@ class BuildAdmin(admin.ModelAdmin):
8690
inlines = (BuildCommandResultInline,)
8791
search_fields = ('project__slug', 'version__slug')
8892

89-
def version_name(self, obj):
90-
return obj.version.verbose_name
93+
def project_slug(self, obj):
94+
return obj.project.slug
95+
96+
def version_slug(self, obj):
97+
return obj.version.slug
9198

9299
def pretty_config(self, instance):
93100
return _pretty_config(instance)

0 commit comments

Comments
 (0)