Skip to content

Commit 106285f

Browse files
authored
Add Search Fields to EmailAdmin (#143)
* 🎉 Add EmailAdmin * 🎨 Make linter happy
1 parent cfae5c2 commit 106285f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/accounts/admin.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
from accounts.models import Email, Major, PhoneNumber, School, Student, User
88

99

10+
class EmailAdmin(admin.ModelAdmin):
11+
list_display = ("email", "user", "is_verified", "is_primary")
12+
list_filter = ("is_verified", "is_primary")
13+
search_fields = ("email", "user__username", "user__first_name", "user__last_name")
14+
readonly_fields = ("user", "email", "is_verified", "is_primary")
15+
16+
1017
class StudentAdmin(admin.ModelAdmin):
1118
readonly_fields = ("user",)
1219
search_fields = ("user__username", "user__first_name", "user__last_name")

0 commit comments

Comments
 (0)