mirror of https://github.com/jumpserver/jumpserver
Modify api: complete some setting
parent
be92ac58ae
commit
b97b34961c
|
@ -2,14 +2,9 @@
|
|||
#
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from rest_framework import routers
|
||||
|
||||
from .api import UserViewSet
|
||||
|
||||
|
||||
router = routers.DefaultRouter()
|
||||
router.register(r'users', UserViewSet)
|
||||
|
||||
urlpatterns = [
|
||||
url(r'v1/', include(router.urls)),
|
||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_fr
|
||||
]
|
||||
|
|
|
@ -6,7 +6,19 @@ from rest_framework import serializers
|
|||
from .models import Role, User, UserGroup
|
||||
|
||||
|
||||
class UserSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class UserSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = User
|
||||
fields =
|
||||
exclude = ['first_name', 'last_name', 'is_staff']
|
||||
|
||||
|
||||
class UserGroupSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = UserGroup
|
||||
fields = '__all__'
|
||||
|
||||
|
||||
class RoleSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Role
|
||||
fields = '__all__'
|
||||
|
|
Loading…
Reference in New Issue