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
7316661e
Commit
7316661e
authored
Jan 12, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 启动加载common setting
parent
f6056426
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
signals_handler.py
apps/common/signals_handler.py
+5
-3
No files found.
apps/common/signals_handler.py
View file @
7316661e
# -*- coding: utf-8 -*-
#
import
ldap
from
django.dispatch
import
receiver
from
django.db.models.signals
import
post_save
from
django.conf
import
settings
from
django
_auth_ldap.config
import
LDAPSearch
from
django
.db.utils
import
ProgrammingError
,
OperationalError
from
.models
import
Setting
from
.utils
import
get_logger
...
...
@@ -25,7 +24,10 @@ def refresh_settings_on_changed(sender, instance=None, **kwargs):
def
refresh_all_settings_on_django_ready
(
sender
,
**
kwargs
):
logger
.
debug
(
"Receive django ready signal"
)
logger
.
debug
(
" - fresh all settings"
)
Setting
.
refresh_all_settings
()
try
:
Setting
.
refresh_all_settings
()
except
(
ProgrammingError
,
OperationalError
):
pass
@receiver
(
ldap_auth_enable
,
dispatch_uid
=
"my_unique_identifier"
)
...
...
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