change keys of organization type, import search field to users
This commit is contained in:
@@ -30,6 +30,7 @@ from rest_framework.response import Response
|
||||
from common.tools import CustomOperations
|
||||
from rest_framework.views import APIView
|
||||
from django.core.cache import cache
|
||||
from rest_framework import filters
|
||||
from rest_framework import status
|
||||
from django.db import transaction
|
||||
from common.sms import send_sms
|
||||
@@ -45,6 +46,8 @@ class UserViewSet(ModelViewSet):
|
||||
""" Crud operations for user model """
|
||||
queryset = User.objects.all()
|
||||
serializer_class = UserSerializer
|
||||
filter_backends = [filters.SearchFilter]
|
||||
search_fields = ['name', 'mobile', 'national_code']
|
||||
|
||||
@transaction.atomic
|
||||
def create(self, request, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user