Skip to content

Commit 07bc0c3

Browse files
authored
Merge pull request #8431 from saadmk11/remote-repo-org-admin-page
2 parents 2c87233 + 0a84565 commit 07bc0c3

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

readthedocs/oauth/admin.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,36 @@ class RemoteRepositoryAdmin(admin.ModelAdmin):
1616

1717
"""Admin configuration for the RemoteRepository model."""
1818

19+
readonly_fields = ('created', 'modified',)
1920
raw_id_fields = ('organization',)
21+
list_select_related = ('organization',)
22+
list_filter = ('vcs_provider', 'vcs', 'private',)
23+
search_fields = ('name', 'full_name', 'remote_id',)
24+
list_display = (
25+
'id',
26+
'full_name',
27+
'html_url',
28+
'private',
29+
'organization',
30+
'get_vcs_provider_display',
31+
'get_vcs_display',
32+
)
33+
34+
35+
class RemoteOrganizationAdmin(admin.ModelAdmin):
36+
37+
"""Admin configuration for the RemoteOrganization model."""
38+
39+
readonly_fields = ('created', 'modified',)
40+
search_fields = ('name', 'slug', 'email', 'url', 'remote_id',)
41+
list_filter = ('vcs_provider',)
42+
list_display = (
43+
'id',
44+
'name',
45+
'slug',
46+
'email',
47+
'get_vcs_provider_display',
48+
)
2049

2150

2251
class RemoteRepositoryRelationAdmin(admin.ModelAdmin):
@@ -37,5 +66,5 @@ class RemoteOrganizationRelationAdmin(admin.ModelAdmin):
3766

3867
admin.site.register(RemoteRepository, RemoteRepositoryAdmin)
3968
admin.site.register(RemoteRepositoryRelation, RemoteRepositoryRelationAdmin)
40-
admin.site.register(RemoteOrganization)
69+
admin.site.register(RemoteOrganization, RemoteOrganizationAdmin)
4170
admin.site.register(RemoteOrganizationRelation, RemoteOrganizationRelationAdmin)

0 commit comments

Comments
 (0)