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
bcae7bea
Commit
bcae7bea
authored
Aug 16, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload avatar
parent
93530226
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
2 deletions
+40
-2
settings.py
apps/jumpserver/settings.py
+1
-0
forms.py
apps/users/forms.py
+1
-1
0006_merge_20160817_0032.py
apps/users/migrations/0006_merge_20160817_0032.py
+16
-0
0007_auto_20160817_0032.py
apps/users/migrations/0007_auto_20160817_0032.py
+20
-0
models.py
apps/users/models.py
+1
-1
_user.html
apps/users/templates/users/_user.html
+1
-0
No files found.
apps/jumpserver/settings.py
View file @
bcae7bea
...
...
@@ -131,3 +131,4 @@ STATICFILES_DIRS = (
AUTH_USER_MODEL
=
'users.User'
BOOTSTRAP_COLUMN_COUNT
=
11
MEDIA_ROOT
=
os
.
path
.
join
(
BASE_DIR
,
'img'
)
.
replace
(
'
\\
'
,
'/'
)
+
'/'
apps/users/forms.py
View file @
bcae7bea
...
...
@@ -10,7 +10,7 @@ class UserForm(ModelForm):
class
Meta
:
model
=
User
fields
=
[
'username'
,
'name'
,
'email'
,
'groups'
,
'wechat'
,
'username'
,
'name'
,
'email'
,
'groups'
,
'wechat'
,
'avatar'
,
'phone'
,
'enable_2FA'
,
'role'
,
'date_expired'
,
'comment'
,
]
# widgets = {
...
...
apps/users/migrations/0006_merge_20160817_0032.py
0 → 100644
View file @
bcae7bea
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-16 16:32
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'users'
,
'0005_auto_20160816_1358'
),
(
'users'
,
'0005_auto_20160816_2252'
),
]
operations
=
[
]
apps/users/migrations/0007_auto_20160817_0032.py
0 → 100644
View file @
bcae7bea
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-16 16:32
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'users'
,
'0006_merge_20160817_0032'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'avatar'
,
field
=
models
.
ImageField
(
blank
=
True
,
upload_to
=
'avatar'
,
verbose_name
=
'
\u5934\u50cf
'
),
),
]
apps/users/models.py
View file @
bcae7bea
...
...
@@ -61,7 +61,7 @@ class User(AbstractUser):
name
=
models
.
CharField
(
max_length
=
20
,
verbose_name
=
'姓名'
,
help_text
=
'* required'
)
email
=
models
.
EmailField
(
max_length
=
30
,
unique
=
True
,
verbose_name
=
'邮件'
,
help_text
=
'* required'
)
groups
=
models
.
ManyToManyField
(
UserGroup
,
verbose_name
=
'用户组'
)
avatar
=
models
.
ImageField
(
verbose_name
=
'头像'
,
blank
=
True
)
avatar
=
models
.
ImageField
(
upload_to
=
"avatar"
,
verbose_name
=
'头像'
,
blank
=
True
)
wechat
=
models
.
CharField
(
max_length
=
30
,
blank
=
True
,
verbose_name
=
'微信'
)
phone
=
models
.
CharField
(
max_length
=
20
,
blank
=
True
,
verbose_name
=
'手机号'
)
enable_2FA
=
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'启用二次验证'
)
...
...
apps/users/templates/users/_user.html
View file @
bcae7bea
...
...
@@ -49,6 +49,7 @@
</div>
<div
class=
"hr-line-dashed"
></div>
<h3>
信息
</h3>
{{ form.avatar|bootstrap_horizontal }}
{{ form.phone|bootstrap_horizontal }}
{{ form.wechat|bootstrap_horizontal }}
{{ form.comment|bootstrap_horizontal }}
...
...
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