Skip to content

Commit a4904af

Browse files
authored
BoD election transparency report (BE) (#2448)
* BoD election transparency report (BE) * Update code
1 parent f60159f commit a4904af

33 files changed

+2070
-11
lines changed

backend/apps/github/admin/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Github app admin."""
22

3+
from .commit import CommitAdmin
34
from .issue import IssueAdmin
45
from .label import LabelAdmin
56
from .milestone import MilestoneAdmin
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""GitHub app Commit model admin."""
2+
3+
from django.contrib import admin
4+
5+
from apps.github.models.commit import Commit
6+
7+
8+
class CommitAdmin(admin.ModelAdmin):
9+
"""Admin for Commit model."""
10+
11+
autocomplete_fields = (
12+
"author",
13+
"committer",
14+
"repository",
15+
)
16+
list_display = (
17+
"sha",
18+
"repository",
19+
"author",
20+
"created_at",
21+
)
22+
list_filter = ("created_at",)
23+
search_fields = (
24+
"sha",
25+
"message",
26+
"node_id",
27+
"repository__name",
28+
"author__login",
29+
)
30+
31+
32+
admin.site.register(Commit, CommitAdmin)

backend/apps/github/admin/user.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
from django.contrib import admin
44

55
from apps.github.models.user import User
6+
from apps.owasp.models.member_profile import MemberProfile
7+
8+
9+
class MemberProfileInline(admin.StackedInline):
10+
"""MemberProfile inline for User admin."""
11+
12+
model = MemberProfile
13+
can_delete = False
14+
verbose_name_plural = "OWASP Member Profile"
15+
fields = ("owasp_slack_id",)
616

717

818
class UserAdmin(admin.ModelAdmin):
919
"""Admin for User model."""
1020

21+
inlines = (MemberProfileInline,)
1122
list_display = (
1223
"title",
1324
"created_at",

0 commit comments

Comments
 (0)