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
ba3f46fb
Commit
ba3f46fb
authored
Sep 03, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
i18n
parent
0b406b69
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
settings.py
apps/jumpserver/settings.py
+3
-0
views.py
apps/users/views.py
+2
-1
No files found.
apps/jumpserver/settings.py
View file @
ba3f46fb
...
@@ -80,6 +80,7 @@ MIDDLEWARE = [
...
@@ -80,6 +80,7 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware'
,
'django.contrib.auth.middleware.AuthenticationMiddleware'
,
'django.contrib.messages.middleware.MessageMiddleware'
,
'django.contrib.messages.middleware.MessageMiddleware'
,
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
'django.middleware.clickjacking.XFrameOptionsMiddleware'
,
'django.middleware.locale.LocaleMiddleware'
,
]
]
ROOT_URLCONF
=
'jumpserver.urls'
ROOT_URLCONF
=
'jumpserver.urls'
...
@@ -307,3 +308,5 @@ CELERY_RESULT_BACKEND = BROKER_URL
...
@@ -307,3 +308,5 @@ CELERY_RESULT_BACKEND = BROKER_URL
# Captcha settings, more see https://django-simple-captcha.readthedocs.io/en/latest/advanced.html
# Captcha settings, more see https://django-simple-captcha.readthedocs.io/en/latest/advanced.html
CAPTCHA_IMAGE_SIZE
=
(
75
,
33
)
CAPTCHA_IMAGE_SIZE
=
(
75
,
33
)
CAPTCHA_FOREGROUND_COLOR
=
'#001100'
CAPTCHA_FOREGROUND_COLOR
=
'#001100'
#
apps/users/views.py
View file @
ba3f46fb
...
@@ -7,6 +7,7 @@ import logging
...
@@ -7,6 +7,7 @@ import logging
from
django.shortcuts
import
get_object_or_404
,
reverse
,
render
,
Http404
,
redirect
from
django.shortcuts
import
get_object_or_404
,
reverse
,
render
,
Http404
,
redirect
from
django.http
import
HttpResponseRedirect
from
django.http
import
HttpResponseRedirect
from
django.urls
import
reverse_lazy
from
django.urls
import
reverse_lazy
from
django.utils.translation
import
ugettext
as
_
from
django.db.models
import
Q
from
django.db.models
import
Q
from
django.views.generic.base
import
View
,
TemplateView
from
django.views.generic.base
import
View
,
TemplateView
from
django.views.generic.list
import
ListView
from
django.views.generic.list
import
ListView
...
@@ -50,7 +51,7 @@ class UserLoginView(FormView):
...
@@ -50,7 +51,7 @@ class UserLoginView(FormView):
user
=
authenticate
(
username
=
username
,
password
=
password
)
user
=
authenticate
(
username
=
username
,
password
=
password
)
if
user
is
None
:
if
user
is
None
:
kwargs
.
update
({
'errors'
:
'账号密码不正确'
})
kwargs
.
update
({
'errors'
:
_
(
'Username or password invalid'
)
})
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
return
self
.
get
(
request
,
*
args
,
**
kwargs
)
login
(
request
,
user
)
login
(
request
,
user
)
...
...
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