Skip to content

Commit

Permalink
unregister Token if not debug and unregister django's default Group
Browse files Browse the repository at this point in the history
  • Loading branch information
d2avids committed Aug 12, 2024
1 parent 96ec3a3 commit 4f14529
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/users/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from rest_framework.authtoken.models import TokenProxy
from django.contrib.auth.models import Group
from django.conf import settings

from users.models import ChildrenGroup, User, Region, Child

Expand Down Expand Up @@ -112,3 +115,8 @@ def get_queryset(self, request):
@admin.display(description='id педагога')
def educator_id(self, obj):
return obj.user.id


admin.site.unregister(Group)
if not settings.DEBUG:
admin.site.unregister(TokenProxy)

0 comments on commit 4f14529

Please sign in to comment.