Skip to content

Commit

Permalink
refactor: code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
neronkl committed Sep 18, 2023
1 parent 314b7f8 commit e2357ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bk-user/bkuser/apps/data_source/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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.
"""
import uuid

from django.conf import settings
from django.db import models
Expand Down Expand Up @@ -57,7 +58,7 @@ def is_local(self) -> bool:

class DataSourceUser(TimestampedModel):
data_source = models.ForeignKey(DataSource, on_delete=models.PROTECT, db_constraint=False)
# code = models.CharField("用户标识", max_length=128, default=uuid.uuid4)
code = models.CharField("用户标识", max_length=128, default=uuid.uuid4)

# ----------------------- 内置字段相关 -----------------------
username = models.CharField("用户名", max_length=128)
Expand All @@ -78,7 +79,7 @@ class DataSourceUser(TimestampedModel):
class Meta:
ordering = ["id"]
unique_together = [
# ("code", "data_source"),
("code", "data_source"),
("username", "data_source"),
]

Expand Down

0 comments on commit e2357ef

Please sign in to comment.