diff --git a/apps/assets/migrations/0059_systemuser_ad_domain.py b/apps/assets/migrations/0059_systemuser_ad_domain.py new file mode 100644 index 000000000..10d5826a5 --- /dev/null +++ b/apps/assets/migrations/0059_systemuser_ad_domain.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.13 on 2020-10-28 11:03 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('assets', '0058_auto_20201023_1115'), + ] + + operations = [ + migrations.AddField( + model_name='systemuser', + name='ad_domain', + field=models.CharField(default='', max_length=256), + ), + ] diff --git a/apps/assets/models/user.py b/apps/assets/models/user.py index 087a05bef..8b878ecde 100644 --- a/apps/assets/models/user.py +++ b/apps/assets/models/user.py @@ -104,6 +104,7 @@ class SystemUser(BaseUser): token = models.TextField(default='', verbose_name=_('Token')) home = models.CharField(max_length=4096, default='', verbose_name=_('Home'), blank=True) system_groups = models.CharField(default='', max_length=4096, verbose_name=_('System groups'), blank=True) + ad_domain = models.CharField(default='', max_length=256) _prefer = 'system_user' def __str__(self): diff --git a/apps/assets/serializers/system_user.py b/apps/assets/serializers/system_user.py index 2e3701b6a..cfc3965b9 100644 --- a/apps/assets/serializers/system_user.py +++ b/apps/assets/serializers/system_user.py @@ -6,7 +6,6 @@ from common.serializers import AdaptedBulkListSerializer from common.mixins.serializers import BulkSerializerMixin from common.utils import ssh_pubkey_gen from orgs.mixins.serializers import BulkOrgResourceModelSerializer -from assets.models import Node from ..models import SystemUser, Asset from .base import AuthSerializerMixin @@ -35,7 +34,7 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): 'auto_push', 'cmd_filters', 'sudo', 'shell', 'comment', 'auto_generate_key', 'sftp_root', 'token', 'assets_amount', 'date_created', 'created_by', - 'home', 'system_groups' + 'home', 'system_groups', 'ad_domain' ] extra_kwargs = { 'password': {"write_only": True}, @@ -154,7 +153,7 @@ class SystemUserListSerializer(SystemUserSerializer): 'priority', "username_same_with_user", 'auto_push', 'sudo', 'shell', 'comment', "assets_amount", 'home', 'system_groups', - 'auto_generate_key', + 'auto_generate_key', 'ad_domain', 'sftp_root', ] @@ -179,7 +178,8 @@ class SystemUserWithAuthInfoSerializer(SystemUserSerializer): 'login_mode', 'login_mode_display', 'priority', 'username_same_with_user', 'auto_push', 'sudo', 'shell', 'comment', - 'auto_generate_key', 'sftp_root', 'token' + 'auto_generate_key', 'sftp_root', 'token', + 'ad_domain', ] extra_kwargs = { 'nodes_amount': {'label': _('Node')},