switch to drf_yasg
This commit is contained in:
		
							
								
								
									
										23
									
								
								passbook/admin/api/v1/users.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								passbook/admin/api/v1/users.py
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,23 @@ | ||||
| """passbook admin user API""" | ||||
| from rest_framework.permissions import IsAdminUser | ||||
| from rest_framework.serializers import ModelSerializer | ||||
| from rest_framework.viewsets import ModelViewSet | ||||
|  | ||||
| from passbook.core.models import User | ||||
|  | ||||
|  | ||||
| class UserSerializer(ModelSerializer): | ||||
|     """User Serializer""" | ||||
|  | ||||
|     class Meta: | ||||
|         model = User | ||||
|         fields = ['is_superuser', 'username', 'first_name', 'last_name', 'email', 'date_joined', | ||||
|                   'uuid'] | ||||
|  | ||||
|  | ||||
| class UserViewSet(ModelViewSet): | ||||
|     """User Viewset""" | ||||
|  | ||||
|     permission_classes = [IsAdminUser] | ||||
|     serializer_class = UserSerializer | ||||
|     queryset = User.objects.all() | ||||
		Reference in New Issue
	
	Block a user
	 Jens Langhammer
					Jens Langhammer