Skip to content

Commit

Permalink
feat: user fields CURD #1205
Browse files Browse the repository at this point in the history
  • Loading branch information
Canway-shiisa committed Oct 7, 2023
1 parent 5631058 commit 3924ffe
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 115 deletions.
4 changes: 2 additions & 2 deletions src/bk-user/bkuser/apis/web/tenant_setting/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from rest_framework import serializers

from bkuser.apps.tenant.models import TenantUserCustomField
from bkuser.apps.tenant_setting.constants import UserFieldDataType
from bkuser.apps.tenant_setting.models import TenantUserCustomFieldOptions
from bkuser.apps.tenant.constants import UserFieldDataType
from bkuser.apps.tenant.data_models import TenantUserCustomFieldOptions

logger = logging.getLogger(__name__)

Expand Down
4 changes: 2 additions & 2 deletions src/bk-user/bkuser/apis/web/tenant_setting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get(self, request, *args, **kwargs):
slz = TenantUserFieldOutputSLZ(
instance={
"builtin_fields": UserBuiltinField.objects.all(),
"custom_fields": TenantUserCustomField.objects.filter(tenant_id=tenant_id).all(),
"custom_fields": TenantUserCustomField.objects.filter(tenant_id=tenant_id),
}
)
return Response(slz.data)
Expand Down Expand Up @@ -94,7 +94,7 @@ def put(self, request, *args, **kwargs):
custom_field.options = data["options"]
custom_field.save()

return Response()
return Response(status=status.HTTP_204_NO_CONTENT)

@swagger_auto_schema(
tags=["tenant-setting"],
Expand Down
10 changes: 0 additions & 10 deletions src/bk-user/bkuser/apps/tenant_setting/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions src/bk-user/bkuser/apps/tenant_setting/apps.py

This file was deleted.

22 changes: 0 additions & 22 deletions src/bk-user/bkuser/apps/tenant_setting/constants.py

This file was deleted.

52 changes: 0 additions & 52 deletions src/bk-user/bkuser/apps/tenant_setting/migrations/0001_initial.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/bk-user/bkuser/apps/tenant_setting/migrations/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion src/bk-user/bkuser/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"bkuser.apps.sync",
"bkuser.apps.idp",
"bkuser.apps.natural_user",
"bkuser.apps.tenant_setting",
]

MIDDLEWARE = [
Expand Down

0 comments on commit 3924ffe

Please sign in to comment.