Commit 091cf39e authored by ibuler's avatar ibuler

[Bugfix] ldap可以修改密码问题,platform大小写问题

parent 0df7c690
......@@ -277,7 +277,8 @@ class BulkImportAssetView(AdminUserRequiredMixin, JSONResponseMixin, FormView):
v = ''
elif k == 'domain':
v = get_object_or_none(Domain, name=v)
elif k == 'platform':
v = v.lower().capitalize()
if v != '':
asset_dict[k] = v
......
......@@ -69,6 +69,7 @@ class BasicSettingForm(BaseForm):
)
EMAIL_SUBJECT_PREFIX = forms.CharField(
max_length=1024, label=_("Email Subject Prefix"),
help_text=_("Tips: Some word will be intercept by mail provider")
)
......
......@@ -314,7 +314,7 @@ EMAIL_HOST_USER = 'noreply@jumpserver.org'
EMAIL_HOST_PASSWORD = ''
EMAIL_USE_SSL = False
EMAIL_USE_TLS = False
EMAIL_SUBJECT_PREFIX = '[Jumpserver] '
EMAIL_SUBJECT_PREFIX = '[JMS] '
REST_FRAMEWORK = {
# Use Django's standard `django.contrib.auth` permissions,
......
This diff is collapsed.
......@@ -32,7 +32,7 @@ __all__ = [
class UserViewSet(IDInFilterMixin, BulkModelViewSet):
filter_fields = ('username', 'email', 'name', 'id')
search_fields = filter_fields
queryset = User.objects.all()
queryset = User.objects.exclude(role=User.ROLE_APP)
serializer_class = UserSerializer
permission_classes = (IsOrgAdmin,)
pagination_class = LimitOffsetPagination
......
......@@ -237,8 +237,11 @@ class UserForgotPasswordView(TemplateView):
email = request.POST.get('email')
user = get_object_or_none(User, email=email)
if not user:
return self.get(request, errors=_('Email address invalid, '
'please input again'))
error = _('Email address invalid, please input again')
return self.get(request, errors=error)
elif not user.is_local:
error = _('User auth from {}, go there change password'.format(user.source))
return self.get(request, errors=error)
else:
send_reset_password_mail(user)
return HttpResponseRedirect(
......@@ -270,8 +273,7 @@ class UserResetPasswordSuccessView(TemplateView):
'auto_redirect': True,
}
kwargs.update(context)
return super()\
.get_context_data(**kwargs)
return super().get_context_data(**kwargs)
class UserResetPasswordView(TemplateView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment