Skip to content

Commit 17a1178

Browse files
arkid15rkasya
andauthored
Refactor Nest admin (#1781)
Co-authored-by: Kate Golovanova <[email protected]>
1 parent 6c171a9 commit 17a1178

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

backend/apps/nest/admin/__init__.py

Whitespace-only changes.

backend/apps/nest/admin.py renamed to backend/apps/nest/admin/api_key.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
"""Nest app admin."""
1+
"""Nest app APIKey model admin."""
22

33
from django.contrib import admin
44

55
from apps.nest.models.api_key import ApiKey
6-
from apps.nest.models.user import User
7-
8-
9-
class UserAdmin(admin.ModelAdmin):
10-
"""Admin for User model."""
11-
12-
ordering = ("username",)
13-
search_fields = ("email", "username")
146

157

168
class ApiKeyAdmin(admin.ModelAdmin):
@@ -36,4 +28,3 @@ class ApiKeyAdmin(admin.ModelAdmin):
3628

3729

3830
admin.site.register(ApiKey, ApiKeyAdmin)
39-
admin.site.register(User, UserAdmin)

backend/apps/nest/admin/user.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Nest app User model admin."""
2+
3+
from django.contrib import admin
4+
5+
from apps.nest.models.user import User
6+
7+
8+
class UserAdmin(admin.ModelAdmin):
9+
"""Admin for User model."""
10+
11+
ordering = ("username",)
12+
search_fields = ("email", "username")
13+
14+
15+
admin.site.register(User, UserAdmin)

0 commit comments

Comments
 (0)