Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
# TencentBlueKing is pleased to support the open source community by making
# 蓝鲸智云 - 用户管理 (bk-user) available.
# Copyright (C) 2017 Tencent. All rights reserved.
# Licensed under the MIT License (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://opensource.org/licenses/MIT
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific language governing permissions and
# limitations under the License.
#
# We undertake not to change the open source license (MIT license) applicable
# to the current version of the project delivered to anyone in the future.
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('data_source', '0002_init_builtin_data_source_plugin'),
]

operations = [
migrations.AlterUniqueTogether(
name='datasource',
unique_together=set(),
),
migrations.AddField(
model_name='datasource',
name='username_suffix',
field=models.CharField(default='', max_length=32, verbose_name='用户名后缀'),
),
]
5 changes: 2 additions & 3 deletions src/bk-user/bkuser/apps/data_source/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,13 @@ class DataSource(AuditedModel):
sync_config = models.JSONField("同步任务配置", default=dict)
# 字段映射,外部数据源提供商,用户数据字段映射到租户用户数据字段
field_mapping = models.JSONField("用户字段映射", default=list)
# 用户名后缀,区分不同数据源的用户,防止用户名重复
username_suffix = models.CharField("用户名后缀", max_length=32, default="")

objects = DataSourceManager()

class Meta:
ordering = ["id"]
unique_together = [
("owner_tenant_id", "type"),
]

@property
def is_local(self) -> bool:
Expand Down
Loading