mirror of https://github.com/jumpserver/jumpserver
[Update] 修改settings为common_settings
parent
cdf8398169
commit
1f502e02c7
|
@ -3,6 +3,7 @@ from django.conf import settings
|
||||||
from celery import shared_task
|
from celery import shared_task
|
||||||
from .utils import get_logger
|
from .utils import get_logger
|
||||||
from .models import Setting
|
from .models import Setting
|
||||||
|
from common.models import common_settings
|
||||||
|
|
||||||
|
|
||||||
logger = get_logger(__file__)
|
logger = get_logger(__file__)
|
||||||
|
@ -28,7 +29,7 @@ def send_mail_async(*args, **kwargs):
|
||||||
|
|
||||||
if len(args) == 3:
|
if len(args) == 3:
|
||||||
args = list(args)
|
args = list(args)
|
||||||
args[0] = settings.EMAIL_SUBJECT_PREFIX + args[0]
|
args[0] = common_settings.EMAIL_SUBJECT_PREFIX + args[0]
|
||||||
args.insert(2, settings.EMAIL_HOST_USER)
|
args.insert(2, settings.EMAIL_HOST_USER)
|
||||||
args = tuple(args)
|
args = tuple(args)
|
||||||
|
|
||||||
|
|
|
@ -75,32 +75,6 @@
|
||||||
{% block custom_foot_js %}
|
{% block custom_foot_js %}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(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:mail-testing' %}";
|
|
||||||
|
|
||||||
function error(message) {
|
|
||||||
toastr.error(message)
|
|
||||||
}
|
|
||||||
|
|
||||||
function success(message) {
|
|
||||||
toastr.success(message.msg)
|
|
||||||
}
|
|
||||||
APIUpdateAttr({
|
|
||||||
url: the_url,
|
|
||||||
body: JSON.stringify(data),
|
|
||||||
method: "POST",
|
|
||||||
flash_message: false,
|
|
||||||
success: success,
|
|
||||||
error: error
|
|
||||||
});
|
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -37,7 +37,8 @@ def reverse(view_name, urlconf=None, args=None, kwargs=None,
|
||||||
kwargs=kwargs, current_app=current_app)
|
kwargs=kwargs, current_app=current_app)
|
||||||
|
|
||||||
if external:
|
if external:
|
||||||
url = settings.SITE_URL.strip('/') + url
|
from common.models import common_settings
|
||||||
|
url = common_settings.SITE_URL.strip('/') + url
|
||||||
return url
|
return url
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -152,6 +152,9 @@ function activeNav() {
|
||||||
$('#' + app + ' #' + resource).addClass('active');
|
$('#' + app + ' #' + resource).addClass('active');
|
||||||
$('#' + app + ' #' + resource + ' #' + item + ' a').css('color', '#ffffff');
|
$('#' + app + ' #' + resource + ' #' + item + ' a').css('color', '#ffffff');
|
||||||
}
|
}
|
||||||
|
else if (app === 'settings'){
|
||||||
|
$("#" + app).addClass('active');
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
$("#" + app).addClass('active');
|
$("#" + app).addClass('active');
|
||||||
$('#' + app + ' #' + resource).addClass('active');
|
$('#' + app + ' #' + resource).addClass('active');
|
||||||
|
|
|
@ -21,6 +21,7 @@ from formtools.wizard.views import SessionWizardView
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
from common.utils import get_object_or_none, get_request_ip
|
from common.utils import get_object_or_none, get_request_ip
|
||||||
|
from common.models import common_settings
|
||||||
from ..models import User, LoginLog
|
from ..models import User, LoginLog
|
||||||
from ..utils import send_reset_password_mail, check_otp_code, \
|
from ..utils import send_reset_password_mail, check_otp_code, \
|
||||||
redirect_user_first_login_or_index, get_user_or_tmp_user, \
|
redirect_user_first_login_or_index, get_user_or_tmp_user, \
|
||||||
|
@ -318,7 +319,7 @@ class UserFirstLoginView(LoginRequiredMixin, SessionWizardView):
|
||||||
user.is_public_key_valid = True
|
user.is_public_key_valid = True
|
||||||
user.save()
|
user.save()
|
||||||
context = {
|
context = {
|
||||||
'user_guide_url': settings.USER_GUIDE_URL
|
'user_guide_url': common_settings.USER_GUIDE_URL
|
||||||
}
|
}
|
||||||
return render(self.request, 'users/first_login_done.html', context)
|
return render(self.request, 'users/first_login_done.html', context)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue