Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gjl2004yn
jumpserver
提交
05255f85
J
jumpserver
项目概览
gjl2004yn
/
jumpserver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jumpserver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
05255f85
编写于
2月 26, 2018
作者:
Q
q4speed
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev' into dev
上级
c96a107e
e2cb1287
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
265 addition
and
215 deletion
+265
-215
apps/assets/forms/asset.py
apps/assets/forms/asset.py
+2
-2
apps/assets/templates/assets/admin_user_detail.html
apps/assets/templates/assets/admin_user_detail.html
+2
-2
apps/assets/templates/assets/asset_list.html
apps/assets/templates/assets/asset_list.html
+3
-3
apps/common/api.py
apps/common/api.py
+1
-2
apps/common/forms.py
apps/common/forms.py
+9
-1
apps/common/templates/common/terminal_setting.html
apps/common/templates/common/terminal_setting.html
+76
-50
apps/common/views.py
apps/common/views.py
+3
-0
apps/i18n/zh/LC_MESSAGES/django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
apps/i18n/zh/LC_MESSAGES/django.po
apps/i18n/zh/LC_MESSAGES/django.po
+154
-141
apps/jumpserver/settings.py
apps/jumpserver/settings.py
+8
-10
apps/perms/templates/perms/asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+3
-3
apps/templates/base.html
apps/templates/base.html
+1
-1
apps/users/migrations/0001_initial.py
apps/users/migrations/0001_initial.py
+3
-0
未找到文件。
apps/assets/forms/asset.py
浏览文件 @
05255f85
...
...
@@ -103,10 +103,10 @@ class AssetBulkUpdateForm(forms.ModelForm):
]
widgets
=
{
'labels'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'
L
abels'
)}
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'
Select l
abels'
)}
),
'nodes'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'
N
odes'
)}
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'
Select n
odes'
)}
),
}
...
...
apps/assets/templates/assets/admin_user_detail.html
浏览文件 @
05255f85
...
...
@@ -80,7 +80,7 @@
<div
class=
"col-sm-4"
style=
"padding-left: 0;padding-right: 0"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Replace assets admin user with this' %}
<i
class=
"fa fa-info-circle"
></i>
{% trans 'Replace
node
assets admin user with this' %}
</div>
<div
class=
"panel-body"
>
<table
class=
"table group_edit"
id=
"table-clusters"
>
...
...
@@ -88,7 +88,7 @@
<form>
<tr>
<td
colspan=
"2"
class=
"no-borders"
>
<select
data-placeholder=
"{% trans '
N
odes' %}"
id=
"nodes_selected"
class=
"select2"
style=
"width: 100%"
multiple=
""
tabindex=
"4"
>
<select
data-placeholder=
"{% trans '
Select n
odes' %}"
id=
"nodes_selected"
class=
"select2"
style=
"width: 100%"
multiple=
""
tabindex=
"4"
>
{% for node in nodes %}
<option
value=
"{{ node.id }}"
id=
"opt_{{ node.id }}"
>
{{ node.value }}
</option>
{% endfor %}
...
...
apps/assets/templates/assets/asset_list.html
浏览文件 @
05255f85
...
...
@@ -50,7 +50,7 @@
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"tree-toggle"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
onclick=
"toggle()"
>
<i
class=
"fa fa-angle-left fa-
2
x"
id=
"toggle-icon"
></i>
<i
class=
"fa fa-angle-left fa-x"
id=
"toggle-icon"
></i>
</div>
</div>
<div
class=
"mail-box-header"
>
...
...
@@ -348,12 +348,12 @@ function toggle() {
if
(
show
===
0
)
{
$
(
"
#split-left
"
).
hide
(
500
,
function
()
{
$
(
"
#split-right
"
).
attr
(
"
class
"
,
"
col-lg-12
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-right fa-
2
x
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-right fa-x
"
);
show
=
1
;
});
}
else
{
$
(
"
#split-right
"
).
attr
(
"
class
"
,
"
col-lg-9
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-left fa-
2
x
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-left fa-x
"
);
$
(
"
#split-left
"
).
show
(
500
);
show
=
0
;
}
...
...
apps/common/api.py
浏览文件 @
05255f85
...
...
@@ -9,7 +9,7 @@ from django.core.mail import get_connection, send_mail
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.conf
import
settings
from
.permissions
import
IsSuperUser
from
.permissions
import
IsSuperUser
,
IsAppUser
from
.serializers
import
MailTestSerializer
,
LDAPTestSerializer
...
...
@@ -102,4 +102,3 @@ class DjangoSettingsAPI(APIView):
if
i
.
isupper
():
configs
[
i
]
=
str
(
getattr
(
settings
,
i
))
return
Response
(
configs
)
apps/common/forms.py
浏览文件 @
05255f85
...
...
@@ -127,7 +127,8 @@ class LDAPSettingForm(BaseForm):
"name"
:
"sn"
,
"email"
:
"mail"
}),
help_text
=
_
(
"User attr map present how to map LDAP user attr to jumpserver, username,name,email is jumpserver attr"
)
help_text
=
_
(
"User attr map present how to map LDAP user attr to jumpserver, username,name,email is jumpserver attr"
)
)
# AUTH_LDAP_GROUP_SEARCH_OU = CONFIG.AUTH_LDAP_GROUP_SEARCH_OU
# AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER
...
...
@@ -160,3 +161,10 @@ class TerminalSettingForm(BaseForm):
"You can set other storage and some terminal using"
)
)
TERMINAL_REPLAY_STORAGE
=
DictField
(
label
=
_
(
"Replay storage"
),
help_text
=
_
(
"Set replay storage setting, `default` is the using as default,"
"You can set other storage and some terminal using"
)
)
apps/common/templates/common/terminal_setting.html
浏览文件 @
05255f85
...
...
@@ -12,27 +12,31 @@
<div
class=
"panel-options"
>
<ul
class=
"nav nav-tabs"
>
<li>
<a
href=
"{% url 'settings:basic-setting' %}"
class=
"text-center"
><i
class=
"fa fa-cubes"
></i>
{% trans 'Basic setting' %}
</a>
<a
href=
"{% url 'settings:basic-setting' %}"
class=
"text-center"
><i
class=
"fa fa-cubes"
></i>
{% trans 'Basic setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
<a
href=
"{% url 'settings:email-setting' %}"
class=
"text-center"
><i
class=
"fa fa-envelope"
></i>
{% trans 'Email setting' %}
</a>
</li>
<li>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
<a
href=
"{% url 'settings:ldap-setting' %}"
class=
"text-center"
><i
class=
"fa fa-archive"
></i>
{% trans 'LDAP setting' %}
</a>
</li>
<li
class=
"active"
>
<a
href=
"{% url 'settings:terminal-setting' %}"
class=
"text-center"
><i
class=
"fa fa-hdd-o"
></i>
{% trans 'Terminal setting' %}
</a>
<a
href=
"{% url 'settings:terminal-setting' %}"
class=
"text-center"
><i
class=
"fa fa-hdd-o"
></i>
{% trans 'Terminal setting' %}
</a>
</li>
</ul>
</div>
<div
class=
"tab-content"
>
<div
class=
"col-sm-12"
style=
"padding-left:0"
>
<div
class=
"ibox-content"
style=
"border-width: 0;padding-top: 40px;"
>
<form
action=
""
method=
"post"
class=
"form-horizontal"
>
<div
class=
"ibox-content"
style=
"border-width: 0;padding-top: 40px;"
>
<form
action=
""
method=
"post"
class=
"form-horizontal"
>
{% if form.non_field_errors %}
<div
class=
"alert alert-danger"
>
{{ form.non_field_errors }}
</div>
<div
class=
"alert alert-danger"
>
{{ form.non_field_errors }}
</div>
{% endif %}
{% csrf_token %}
<h3>
{% trans "Basic setting" %}
</h3>
...
...
@@ -41,13 +45,14 @@
{% bootstrap_field field layout="horizontal" %}
{% else %}
<div
class=
"form-group"
>
<label
for=
"{{ field.id_for_label }}"
class=
"col-sm-2 control-label"
>
{{ field.label }}
</label>
<label
for=
"{{ field.id_for_label }}"
class=
"col-sm-2 control-label"
>
{{ field.label }}
</label>
<div
class=
"col-sm-8"
>
<div
class=
"col-sm-1"
>
{{ field }}
</div>
<div
class=
"col-sm-9"
>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
<span
class=
"help-block"
>
{{ field.help_text }}
</span>
</div>
</div>
</div>
...
...
@@ -56,35 +61,54 @@
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans "Command storage" %}
</h3>
<table
class=
"table table-hover "
id=
"task-history-list-table"
>
<table
class=
"table table-hover "
id=
"task-history-list-table"
>
<thead>
<tr>
<th>
{% trans 'Name' %}
</th>
<th>
{% trans 'Type' %}
</th>
</tr>
</thead>
<tbody>
{% for name, setting in command_storage.items %}
<tr>
<t
h>
{% trans 'Name' %}
</th
>
<t
h>
{% trans 'Type' %}
</th
>
<t
d>
{{ name }}
</td
>
<t
d>
{{ setting.TYPE }}
</td
>
</tr>
{% endfor %}
</tbody>
</table>
{#
<button
class=
"btn btn-default btn-circle btn-add-command-storage"
data-toggle=
"modal"
data-target=
"#add_command_storage_model"
tabindex=
"0"
type=
"button"
><i
class=
"fa fa-plus"
></i></button>
#}
{#
<div
class=
"hr-line-dashed"
></div>
#}
{#
<h3>
{% trans "Replay storage" %}
</h3>
#}
<div
class=
"hr-line-dashed"
></div>
<h3>
{% trans "Replay storage" %}
</h3>
<table
class=
"table table-hover "
id=
"task-history-list-table"
>
<thead>
<tr>
<th>
{% trans 'Name' %}
</th>
<th>
{% trans 'Type' %}
</th>
<th>
{% trans 'Setting' %}
</th>
</tr>
</thead>
<tbody>
{% for name, setting in
command
_storage.items %}
{% for name, setting in
replay
_storage.items %}
<tr>
<td>
{{ name }}
</td>
<td>
{{ setting.TYPE }}
</td>
<td>
{{ setting }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{#
<button
class=
"btn btn-default btn-circle btn-add-command-storage"
data-toggle=
"modal"
data-target=
"#add_command_storage_model"
tabindex=
"0"
type=
"button"
><i
class=
"fa fa-plus"
></i></button>
#}
{#
<div
class=
"hr-line-dashed"
></div>
#}
{#
<h3>
{% trans "Replay storage" %}
</h3>
#}
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-default"
type=
"reset"
>
{% trans 'Reset' %}
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
{% trans 'Submit' %}
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
{% trans 'Submit' %}
</button>
</div>
</div>
</form>
</div>
</form>
</div>
</div>
</div>
...
...
@@ -92,38 +116,40 @@
</div>
</div>
</div>
</div>
{% endblock %}
{% block custom_foot_js %}
<script>
$
(
document
).
ready
(
function
()
{
})
.
on
(
"
click
"
,
"
.btn-test
"
,
function
()
{
var
data
=
{};
var
form
=
$
(
"
form
"
).
serializeArray
();
$
.
each
(
form
,
function
(
i
,
field
)
{
data
[
field
.
name
]
=
field
.
value
;
});
<script>
$
(
document
).
ready
(
function
()
{
})
.
on
(
"
click
"
,
"
.btn-test
"
,
function
()
{
var
data
=
{};
var
form
=
$
(
"
form
"
).
serializeArray
();
$
.
each
(
form
,
function
(
i
,
field
)
{
data
[
field
.
name
]
=
field
.
value
;
});
var
the_url
=
"
{% url 'api-common:ldap-testing' %}
"
;
var
the_url
=
"
{% url 'api-common:ldap-testing' %}
"
;
function
error
(
message
)
{
toastr
.
error
(
message
)
}
function
error
(
message
)
{
toastr
.
error
(
message
)
}
function
success
(
message
)
{
toastr
.
success
(
message
.
msg
)
}
function
success
(
message
)
{
toastr
.
success
(
message
.
msg
)
}
APIUpdateAttr
({
url
:
the_url
,
body
:
JSON
.
stringify
(
data
),
method
:
"
POST
"
,
flash_message
:
false
,
success
:
success
,
error
:
error
});
})
.
on
(
'
click
'
,
''
,
function
()
{
APIUpdateAttr
({
url
:
the_url
,
body
:
JSON
.
stringify
(
data
),
method
:
"
POST
"
,
flash_message
:
false
,
success
:
success
,
error
:
error
});
})
.
on
(
'
click
'
,
''
,
function
()
{
})
</script>
})
</script>
{% endblock %}
apps/common/views.py
浏览文件 @
05255f85
...
...
@@ -97,10 +97,12 @@ class TerminalSettingView(AdminUserRequiredMixin, TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
command_storage
=
settings
.
TERMINAL_COMMAND_STORAGE
replay_storage
=
settings
.
TERMINAL_REPLAY_STORAGE
context
=
{
'app'
:
_
(
'Settings'
),
'action'
:
_
(
'Terminal setting'
),
'form'
:
self
.
form_class
(),
'replay_storage'
:
replay_storage
,
'command_storage'
:
command_storage
,
}
kwargs
.
update
(
context
)
...
...
@@ -117,3 +119,4 @@ class TerminalSettingView(AdminUserRequiredMixin, TemplateView):
context
=
self
.
get_context_data
()
context
.
update
({
"form"
:
form
})
return
render
(
request
,
self
.
template_name
,
context
)
apps/i18n/zh/LC_MESSAGES/django.mo
浏览文件 @
05255f85
无法预览此类型文件
apps/i18n/zh/LC_MESSAGES/django.po
浏览文件 @
05255f85
此差异已折叠。
点击以展开。
apps/jumpserver/settings.py
浏览文件 @
05255f85
...
...
@@ -17,7 +17,6 @@ import ldap
from
django_auth_ldap.config
import
LDAPSearch
from
django.urls
import
reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
PROJECT_DIR
=
os
.
path
.
dirname
(
BASE_DIR
)
...
...
@@ -39,11 +38,9 @@ SECRET_KEY = CONFIG.SECRET_KEY
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
CONFIG
.
DEBUG
or
False
# Absolute url for some case, for example email link
SITE_URL
=
CONFIG
.
SITE_URL
or
'http://localhost'
# LOG LEVEL
LOG_LEVEL
=
'DEBUG'
if
DEBUG
else
CONFIG
.
LOG_LEVEL
or
'WARNING'
...
...
@@ -114,7 +111,7 @@ LOGIN_URL = reverse_lazy('users:login')
SESSION_COOKIE_DOMAIN
=
CONFIG
.
SESSION_COOKIE_DOMAIN
or
None
CSRF_COOKIE_DOMAIN
=
CONFIG
.
CSRF_COOKIE_DOMAIN
or
None
SESSION_COOKIE_AGE
=
CONFIG
.
SESSION_COOKIE_AGE
or
3600
*
24
SESSION_COOKIE_AGE
=
CONFIG
.
SESSION_COOKIE_AGE
or
3600
*
24
MESSAGE_STORAGE
=
'django.contrib.messages.storage.cookie.CookieStorage'
# Database
...
...
@@ -250,7 +247,6 @@ STATIC_URL = '/static/'
STATIC_ROOT
=
os
.
path
.
join
(
PROJECT_DIR
,
"data"
,
"static"
)
STATIC_DIR
=
os
.
path
.
join
(
BASE_DIR
,
"static"
)
STATICFILES_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
"static"
),
)
...
...
@@ -265,7 +261,7 @@ MEDIA_ROOT = os.path.join(PROJECT_DIR, 'data', 'media').replace('\\', '/') + '/'
# BOOTSTRAP_COLUMN_COUNT = 11
# Init data or generate fake data source for development
FIXTURE_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
'fixtures'
),]
FIXTURE_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
'fixtures'
),
]
# Email config
EMAIL_HOST
=
CONFIG
.
EMAIL_HOST
...
...
@@ -308,7 +304,6 @@ AUTHENTICATION_BACKENDS = [
# Custom User Auth model
AUTH_USER_MODEL
=
'users.User'
# Auth LDAP settings
AUTH_LDAP
=
CONFIG
.
AUTH_LDAP
AUTH_LDAP_SERVER_URI
=
CONFIG
.
AUTH_LDAP_SERVER_URI
...
...
@@ -319,7 +314,7 @@ AUTH_LDAP_SEARCH_FILTER = CONFIG.AUTH_LDAP_SEARCH_FILTER
AUTH_LDAP_START_TLS
=
CONFIG
.
AUTH_LDAP_START_TLS
AUTH_LDAP_USER_ATTR_MAP
=
CONFIG
.
AUTH_LDAP_USER_ATTR_MAP
AUTH_LDAP_USER_SEARCH
=
LDAPSearch
(
AUTH_LDAP_SEARCH_OU
,
ldap
.
SCOPE_SUBTREE
,
AUTH_LDAP_SEARCH_FILTER
,
AUTH_LDAP_SEARCH_OU
,
ldap
.
SCOPE_SUBTREE
,
AUTH_LDAP_SEARCH_FILTER
,
)
AUTH_LDAP_GROUP_SEARCH_OU
=
CONFIG
.
AUTH_LDAP_GROUP_SEARCH_OU
AUTH_LDAP_GROUP_SEARCH_FILTER
=
CONFIG
.
AUTH_LDAP_GROUP_SEARCH_FILTER
...
...
@@ -332,7 +327,6 @@ AUTH_LDAP_BACKEND = 'django_auth_ldap.backend.LDAPBackend'
if
AUTH_LDAP
:
AUTHENTICATION_BACKENDS
.
insert
(
0
,
AUTH_LDAP_BACKEND
)
# Celery using redis as broker
CELERY_BROKER_URL
=
'redis://:%(password)s@%(host)s:%(port)s/3'
%
{
'password'
:
CONFIG
.
REDIS_PASSWORD
if
CONFIG
.
REDIS_PASSWORD
else
''
,
...
...
@@ -354,7 +348,6 @@ CELERY_REDIRECT_STDOUTS = True
CELERY_REDIRECT_STDOUTS_LEVEL
=
"INFO"
CELERY_WORKER_HIJACK_ROOT_LOGGER
=
False
# Cache use redis
CACHES
=
{
'default'
:
{
...
...
@@ -387,6 +380,11 @@ TERMINAL_COMMAND_STORAGE = {
# },
}
TERMINAL_REPLAY_STORAGE
=
{
"default"
:
{
"TYPE"
:
"server"
,
},
}
# Django bootstrap3 setting, more see http://django-bootstrap3.readthedocs.io/en/latest/settings.html
BOOTSTRAP3
=
{
...
...
apps/perms/templates/perms/asset_permission_list.html
浏览文件 @
05255f85
...
...
@@ -49,7 +49,7 @@
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"tree-toggle"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
onclick=
"toggle()"
>
<i
class=
"fa fa-angle-left fa-
2
x"
id=
"toggle-icon"
></i>
<i
class=
"fa fa-angle-left fa-x"
id=
"toggle-icon"
></i>
</div>
</div>
<div
class=
"mail-box-header"
>
...
...
@@ -200,12 +200,12 @@ function toggle() {
if
(
show
===
0
)
{
$
(
"
#split-left
"
).
hide
(
500
,
function
()
{
$
(
"
#split-right
"
).
attr
(
"
class
"
,
"
col-lg-12
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-right fa-
2
x
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-right fa-x
"
);
show
=
1
;
});
}
else
{
$
(
"
#split-right
"
).
attr
(
"
class
"
,
"
col-lg-9
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-left fa-
2
x
"
);
$
(
"
#toggle-icon
"
).
attr
(
"
class
"
,
"
fa fa-angle-left fa-x
"
);
$
(
"
#split-left
"
).
show
(
500
);
show
=
0
;
}
...
...
apps/templates/base.html
浏览文件 @
05255f85
...
...
@@ -17,8 +17,8 @@
{% include '_left_side_bar.html' %}
<div
id=
"page-wrapper"
class=
"gray-bg"
>
{% include '_header_bar.html' %}
{% include '_message.html' %}
{% block help_message %} {% endblock %}
{% include '_message.html' %}
{% block content %}{% endblock %}
{% include '_footer.html' %}
</div>
...
...
apps/users/migrations/0001_initial.py
浏览文件 @
05255f85
...
...
@@ -28,6 +28,9 @@ def add_default_admin(apps, schema_editor):
email
=
"admin@mycomany.com"
,
role
=
"Admin"
,
password
=
make_password
(
"admin"
),
)
group_model
=
apps
.
get_model
(
"users"
,
"UserGroup"
)
default_group
=
group_model
.
objects
.
using
(
db_alias
).
get
(
name
=
"Default"
)
admin
.
groups
.
add
(
default_group
)
class
Migration
(
migrations
.
Migration
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录