1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-19 18:29:23 +00:00

Improve login and create user (#5458)

* add create oauth/ldap/saml user in UserManager

* improve admin add/import users

* improve dingtalk/weixin/work_weixin login/create user

* improve saml login/create user

* improve oauth login/create user

* login ldap user in seahub

* improve invite user

* fix code

* fix github test action

* fix test

* fix saml login

* optimize code

* specify the version of python-ldap

* fix code

* improve code

* add get_old_user

* optimize oauth login code

* optimize code

* remove LDAP_USER_UNIQUE_ID

* remove test_primary_id

* improve authenticate user

* improve saml login

* optimize code
This commit is contained in:
WJH
2023-06-19 13:06:15 +08:00
committed by GitHub
parent 42773a692d
commit 532fa5ef8c
45 changed files with 689 additions and 591 deletions

View File

@@ -12,6 +12,7 @@ from django.utils.translation import gettext_lazy as _
from seahub.base.accounts import User
from seahub.utils import send_html_email
from seahub.profile.models import Profile
SHA1_RE = re.compile('^[a-f0-9]{40}$')
@@ -281,8 +282,14 @@ class RegistrationProfile(models.Model):
subject = ''.join(subject.splitlines())
try:
user = User.objects.get(id=self.emailuser_id)
send_to = user.username
profile = Profile.objects.get_profile_by_user(user.username)
if profile and profile.contact_email:
send_to = profile.contact_email
send_html_email(subject, 'registration/activation_email.html',
ctx_dict, None, [user.username])
ctx_dict, None, [send_to])
except User.DoesNotExist:
pass