Skip to content

Commit

Permalink
Рефакторинг
Browse files Browse the repository at this point in the history
  • Loading branch information
Abramov0Alexandr committed Sep 26, 2023
1 parent 501d4ba commit 926c0b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_user/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

@admin.register(CustomUser)
class UserAdmin(admin.ModelAdmin):
list_display = ('id', 'email', 'first_name', 'last_name', 'is_seller', )
list_display = ('id', 'email', 'first_name', 'last_name', 'shop_name', 'is_seller', )
list_display_links = ('email', )
list_filter = ('is_seller', )
4 changes: 3 additions & 1 deletion custom_user/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import generics, status
from rest_framework.permissions import IsAdminUser
from rest_framework.permissions import IsAdminUser, AllowAny
from rest_framework.response import Response
from custom_user.models import CustomUser
from custom_user.serializers import CustomersListSerializer, VisitorSerializer, SellerSerializer
Expand All @@ -19,6 +19,8 @@ class CustomersListView(generics.ListAPIView):
class CustomerCreateView(generics.CreateAPIView):
"""Контроллер для регистрации новых пользователей."""

permission_classes = [AllowAny]

def get_serializer_class(self):
"""
Метод переопределен для выбора конкретного сериализатора в зависимости от переданных в POST запросе данных.
Expand Down

0 comments on commit 926c0b9

Please sign in to comment.