Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
05255f85
Commit
05255f85
authored
Feb 26, 2018
by
q4speed
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
c96a107e
e2cb1287
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
35 additions
and
24 deletions
+35
-24
asset.py
apps/assets/forms/asset.py
+2
-2
admin_user_detail.html
apps/assets/templates/assets/admin_user_detail.html
+2
-2
asset_list.html
apps/assets/templates/assets/asset_list.html
+3
-3
api.py
apps/common/api.py
+1
-2
forms.py
apps/common/forms.py
+9
-1
terminal_setting.html
apps/common/templates/common/terminal_setting.html
+0
-0
views.py
apps/common/views.py
+3
-0
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+0
-0
settings.py
apps/jumpserver/settings.py
+8
-10
asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+3
-3
base.html
apps/templates/base.html
+1
-1
0001_initial.py
apps/users/migrations/0001_initial.py
+3
-0
No files found.
apps/assets/forms/asset.py
View file @
05255f85
...
@@ -103,10 +103,10 @@ class AssetBulkUpdateForm(forms.ModelForm):
...
@@ -103,10 +103,10 @@ class AssetBulkUpdateForm(forms.ModelForm):
]
]
widgets
=
{
widgets
=
{
'labels'
:
forms
.
SelectMultiple
(
'labels'
:
forms
.
SelectMultiple
(
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'
L
abels'
)}
attrs
=
{
'class'
:
'select2'
,
'data-placeholder'
:
_
(
'
Select l
abels'
)}
),
),
'nodes'
:
forms
.
SelectMultiple
(
'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
View file @
05255f85
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
<div
class=
"col-sm-4"
style=
"padding-left: 0;padding-right: 0"
>
<div
class=
"col-sm-4"
style=
"padding-left: 0;padding-right: 0"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<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>
<div
class=
"panel-body"
>
<div
class=
"panel-body"
>
<table
class=
"table group_edit"
id=
"table-clusters"
>
<table
class=
"table group_edit"
id=
"table-clusters"
>
...
@@ -88,7 +88,7 @@
...
@@ -88,7 +88,7 @@
<form>
<form>
<tr>
<tr>
<td
colspan=
"2"
class=
"no-borders"
>
<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 %}
{% for node in nodes %}
<option
value=
"{{ node.id }}"
id=
"opt_{{ node.id }}"
>
{{ node.value }}
</option>
<option
value=
"{{ node.id }}"
id=
"opt_{{ node.id }}"
>
{{ node.value }}
</option>
{% endfor %}
{% endfor %}
...
...
apps/assets/templates/assets/asset_list.html
View file @
05255f85
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"tree-toggle"
>
<div
class=
"tree-toggle"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
onclick=
"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>
</div>
<div
class=
"mail-box-header"
>
<div
class=
"mail-box-header"
>
...
@@ -348,12 +348,12 @@ function toggle() {
...
@@ -348,12 +348,12 @@ function toggle() {
if
(
show
===
0
)
{
if
(
show
===
0
)
{
$
(
"#split-left"
).
hide
(
500
,
function
()
{
$
(
"#split-left"
).
hide
(
500
,
function
()
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-12"
);
$
(
"#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
;
show
=
1
;
});
});
}
else
{
}
else
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-9"
);
$
(
"#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
);
$
(
"#split-left"
).
show
(
500
);
show
=
0
;
show
=
0
;
}
}
...
...
apps/common/api.py
View file @
05255f85
...
@@ -9,7 +9,7 @@ from django.core.mail import get_connection, send_mail
...
@@ -9,7 +9,7 @@ from django.core.mail import get_connection, send_mail
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.conf
import
settings
from
django.conf
import
settings
from
.permissions
import
IsSuperUser
from
.permissions
import
IsSuperUser
,
IsAppUser
from
.serializers
import
MailTestSerializer
,
LDAPTestSerializer
from
.serializers
import
MailTestSerializer
,
LDAPTestSerializer
...
@@ -102,4 +102,3 @@ class DjangoSettingsAPI(APIView):
...
@@ -102,4 +102,3 @@ class DjangoSettingsAPI(APIView):
if
i
.
isupper
():
if
i
.
isupper
():
configs
[
i
]
=
str
(
getattr
(
settings
,
i
))
configs
[
i
]
=
str
(
getattr
(
settings
,
i
))
return
Response
(
configs
)
return
Response
(
configs
)
apps/common/forms.py
View file @
05255f85
...
@@ -127,7 +127,8 @@ class LDAPSettingForm(BaseForm):
...
@@ -127,7 +127,8 @@ class LDAPSettingForm(BaseForm):
"name"
:
"sn"
,
"name"
:
"sn"
,
"email"
:
"mail"
"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_OU = CONFIG.AUTH_LDAP_GROUP_SEARCH_OU
# AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER
# AUTH_LDAP_GROUP_SEARCH_FILTER = CONFIG.AUTH_LDAP_GROUP_SEARCH_FILTER
...
@@ -160,3 +161,10 @@ class TerminalSettingForm(BaseForm):
...
@@ -160,3 +161,10 @@ class TerminalSettingForm(BaseForm):
"You can set other storage and some terminal using"
"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
View file @
05255f85
This diff is collapsed.
Click to expand it.
apps/common/views.py
View file @
05255f85
...
@@ -97,10 +97,12 @@ class TerminalSettingView(AdminUserRequiredMixin, TemplateView):
...
@@ -97,10 +97,12 @@ class TerminalSettingView(AdminUserRequiredMixin, TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
command_storage
=
settings
.
TERMINAL_COMMAND_STORAGE
command_storage
=
settings
.
TERMINAL_COMMAND_STORAGE
replay_storage
=
settings
.
TERMINAL_REPLAY_STORAGE
context
=
{
context
=
{
'app'
:
_
(
'Settings'
),
'app'
:
_
(
'Settings'
),
'action'
:
_
(
'Terminal setting'
),
'action'
:
_
(
'Terminal setting'
),
'form'
:
self
.
form_class
(),
'form'
:
self
.
form_class
(),
'replay_storage'
:
replay_storage
,
'command_storage'
:
command_storage
,
'command_storage'
:
command_storage
,
}
}
kwargs
.
update
(
context
)
kwargs
.
update
(
context
)
...
@@ -117,3 +119,4 @@ class TerminalSettingView(AdminUserRequiredMixin, TemplateView):
...
@@ -117,3 +119,4 @@ class TerminalSettingView(AdminUserRequiredMixin, TemplateView):
context
=
self
.
get_context_data
()
context
=
self
.
get_context_data
()
context
.
update
({
"form"
:
form
})
context
.
update
({
"form"
:
form
})
return
render
(
request
,
self
.
template_name
,
context
)
return
render
(
request
,
self
.
template_name
,
context
)
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
05255f85
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
05255f85
This diff is collapsed.
Click to expand it.
apps/jumpserver/settings.py
View file @
05255f85
...
@@ -17,7 +17,6 @@ import ldap
...
@@ -17,7 +17,6 @@ import ldap
from
django_auth_ldap.config
import
LDAPSearch
from
django_auth_ldap.config
import
LDAPSearch
from
django.urls
import
reverse_lazy
from
django.urls
import
reverse_lazy
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
PROJECT_DIR
=
os
.
path
.
dirname
(
BASE_DIR
)
PROJECT_DIR
=
os
.
path
.
dirname
(
BASE_DIR
)
...
@@ -39,11 +38,9 @@ SECRET_KEY = CONFIG.SECRET_KEY
...
@@ -39,11 +38,9 @@ SECRET_KEY = CONFIG.SECRET_KEY
# SECURITY WARNING: don't run with debug turned on in production!
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
CONFIG
.
DEBUG
or
False
DEBUG
=
CONFIG
.
DEBUG
or
False
# Absolute url for some case, for example email link
# Absolute url for some case, for example email link
SITE_URL
=
CONFIG
.
SITE_URL
or
'http://localhost'
SITE_URL
=
CONFIG
.
SITE_URL
or
'http://localhost'
# LOG LEVEL
# LOG LEVEL
LOG_LEVEL
=
'DEBUG'
if
DEBUG
else
CONFIG
.
LOG_LEVEL
or
'WARNING'
LOG_LEVEL
=
'DEBUG'
if
DEBUG
else
CONFIG
.
LOG_LEVEL
or
'WARNING'
...
@@ -114,7 +111,7 @@ LOGIN_URL = reverse_lazy('users:login')
...
@@ -114,7 +111,7 @@ LOGIN_URL = reverse_lazy('users:login')
SESSION_COOKIE_DOMAIN
=
CONFIG
.
SESSION_COOKIE_DOMAIN
or
None
SESSION_COOKIE_DOMAIN
=
CONFIG
.
SESSION_COOKIE_DOMAIN
or
None
CSRF_COOKIE_DOMAIN
=
CONFIG
.
CSRF_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'
MESSAGE_STORAGE
=
'django.contrib.messages.storage.cookie.CookieStorage'
# Database
# Database
...
@@ -250,7 +247,6 @@ STATIC_URL = '/static/'
...
@@ -250,7 +247,6 @@ STATIC_URL = '/static/'
STATIC_ROOT
=
os
.
path
.
join
(
PROJECT_DIR
,
"data"
,
"static"
)
STATIC_ROOT
=
os
.
path
.
join
(
PROJECT_DIR
,
"data"
,
"static"
)
STATIC_DIR
=
os
.
path
.
join
(
BASE_DIR
,
"static"
)
STATIC_DIR
=
os
.
path
.
join
(
BASE_DIR
,
"static"
)
STATICFILES_DIRS
=
(
STATICFILES_DIRS
=
(
os
.
path
.
join
(
BASE_DIR
,
"static"
),
os
.
path
.
join
(
BASE_DIR
,
"static"
),
)
)
...
@@ -265,7 +261,7 @@ MEDIA_ROOT = os.path.join(PROJECT_DIR, 'data', 'media').replace('\\', '/') + '/'
...
@@ -265,7 +261,7 @@ MEDIA_ROOT = os.path.join(PROJECT_DIR, 'data', 'media').replace('\\', '/') + '/'
# BOOTSTRAP_COLUMN_COUNT = 11
# BOOTSTRAP_COLUMN_COUNT = 11
# Init data or generate fake data source for development
# 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 config
EMAIL_HOST
=
CONFIG
.
EMAIL_HOST
EMAIL_HOST
=
CONFIG
.
EMAIL_HOST
...
@@ -308,7 +304,6 @@ AUTHENTICATION_BACKENDS = [
...
@@ -308,7 +304,6 @@ AUTHENTICATION_BACKENDS = [
# Custom User Auth model
# Custom User Auth model
AUTH_USER_MODEL
=
'users.User'
AUTH_USER_MODEL
=
'users.User'
# Auth LDAP settings
# Auth LDAP settings
AUTH_LDAP
=
CONFIG
.
AUTH_LDAP
AUTH_LDAP
=
CONFIG
.
AUTH_LDAP
AUTH_LDAP_SERVER_URI
=
CONFIG
.
AUTH_LDAP_SERVER_URI
AUTH_LDAP_SERVER_URI
=
CONFIG
.
AUTH_LDAP_SERVER_URI
...
@@ -319,7 +314,7 @@ AUTH_LDAP_SEARCH_FILTER = CONFIG.AUTH_LDAP_SEARCH_FILTER
...
@@ -319,7 +314,7 @@ AUTH_LDAP_SEARCH_FILTER = CONFIG.AUTH_LDAP_SEARCH_FILTER
AUTH_LDAP_START_TLS
=
CONFIG
.
AUTH_LDAP_START_TLS
AUTH_LDAP_START_TLS
=
CONFIG
.
AUTH_LDAP_START_TLS
AUTH_LDAP_USER_ATTR_MAP
=
CONFIG
.
AUTH_LDAP_USER_ATTR_MAP
AUTH_LDAP_USER_ATTR_MAP
=
CONFIG
.
AUTH_LDAP_USER_ATTR_MAP
AUTH_LDAP_USER_SEARCH
=
LDAPSearch
(
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_OU
=
CONFIG
.
AUTH_LDAP_GROUP_SEARCH_OU
AUTH_LDAP_GROUP_SEARCH_FILTER
=
CONFIG
.
AUTH_LDAP_GROUP_SEARCH_FILTER
AUTH_LDAP_GROUP_SEARCH_FILTER
=
CONFIG
.
AUTH_LDAP_GROUP_SEARCH_FILTER
...
@@ -332,7 +327,6 @@ AUTH_LDAP_BACKEND = 'django_auth_ldap.backend.LDAPBackend'
...
@@ -332,7 +327,6 @@ AUTH_LDAP_BACKEND = 'django_auth_ldap.backend.LDAPBackend'
if
AUTH_LDAP
:
if
AUTH_LDAP
:
AUTHENTICATION_BACKENDS
.
insert
(
0
,
AUTH_LDAP_BACKEND
)
AUTHENTICATION_BACKENDS
.
insert
(
0
,
AUTH_LDAP_BACKEND
)
# Celery using redis as broker
# Celery using redis as broker
CELERY_BROKER_URL
=
'redis://:
%(password)
s@
%(host)
s:
%(port)
s/3'
%
{
CELERY_BROKER_URL
=
'redis://:
%(password)
s@
%(host)
s:
%(port)
s/3'
%
{
'password'
:
CONFIG
.
REDIS_PASSWORD
if
CONFIG
.
REDIS_PASSWORD
else
''
,
'password'
:
CONFIG
.
REDIS_PASSWORD
if
CONFIG
.
REDIS_PASSWORD
else
''
,
...
@@ -354,7 +348,6 @@ CELERY_REDIRECT_STDOUTS = True
...
@@ -354,7 +348,6 @@ CELERY_REDIRECT_STDOUTS = True
CELERY_REDIRECT_STDOUTS_LEVEL
=
"INFO"
CELERY_REDIRECT_STDOUTS_LEVEL
=
"INFO"
CELERY_WORKER_HIJACK_ROOT_LOGGER
=
False
CELERY_WORKER_HIJACK_ROOT_LOGGER
=
False
# Cache use redis
# Cache use redis
CACHES
=
{
CACHES
=
{
'default'
:
{
'default'
:
{
...
@@ -387,6 +380,11 @@ TERMINAL_COMMAND_STORAGE = {
...
@@ -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
# Django bootstrap3 setting, more see http://django-bootstrap3.readthedocs.io/en/latest/settings.html
BOOTSTRAP3
=
{
BOOTSTRAP3
=
{
...
...
apps/perms/templates/perms/asset_permission_list.html
View file @
05255f85
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"tree-toggle"
>
<div
class=
"tree-toggle"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
onclick=
"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>
</div>
<div
class=
"mail-box-header"
>
<div
class=
"mail-box-header"
>
...
@@ -200,12 +200,12 @@ function toggle() {
...
@@ -200,12 +200,12 @@ function toggle() {
if
(
show
===
0
)
{
if
(
show
===
0
)
{
$
(
"#split-left"
).
hide
(
500
,
function
()
{
$
(
"#split-left"
).
hide
(
500
,
function
()
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-12"
);
$
(
"#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
;
show
=
1
;
});
});
}
else
{
}
else
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-9"
);
$
(
"#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
);
$
(
"#split-left"
).
show
(
500
);
show
=
0
;
show
=
0
;
}
}
...
...
apps/templates/base.html
View file @
05255f85
...
@@ -17,8 +17,8 @@
...
@@ -17,8 +17,8 @@
{% include '_left_side_bar.html' %}
{% include '_left_side_bar.html' %}
<div
id=
"page-wrapper"
class=
"gray-bg"
>
<div
id=
"page-wrapper"
class=
"gray-bg"
>
{% include '_header_bar.html' %}
{% include '_header_bar.html' %}
{% include '_message.html' %}
{% block help_message %} {% endblock %}
{% block help_message %} {% endblock %}
{% include '_message.html' %}
{% block content %}{% endblock %}
{% block content %}{% endblock %}
{% include '_footer.html' %}
{% include '_footer.html' %}
</div>
</div>
...
...
apps/users/migrations/0001_initial.py
View file @
05255f85
...
@@ -28,6 +28,9 @@ def add_default_admin(apps, schema_editor):
...
@@ -28,6 +28,9 @@ def add_default_admin(apps, schema_editor):
email
=
"admin@mycomany.com"
,
role
=
"Admin"
,
email
=
"admin@mycomany.com"
,
role
=
"Admin"
,
password
=
make_password
(
"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
):
class
Migration
(
migrations
.
Migration
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment