Skip to content

Commit

Permalink
修复开启2fa登录后无法更新ding_user_id的问题 (#2104)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick2wang authored Mar 31, 2023
1 parent 17bca47 commit f275b56
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sql_api/api_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
from django.http import Http404
from sql.models import Users, ResourceGroup, TwoFactorAuthConfig
from common.twofa import TwoFactorAuthBase, get_authenticator
from common.config import SysConfig
from common.utils.ding_api import get_ding_user_id
import random
import json
import time
Expand Down Expand Up @@ -421,4 +423,8 @@ def post(self, request):
login(request, user, backend="django.contrib.auth.backends.ModelBackend")
request.session.set_expiry(settings.SESSION_COOKIE_AGE)

# 更新用户ding_user_id
if SysConfig().get("ding_to_person") is True and "admin" not in engineer:
get_ding_user_id(engineer)

return Response(result)

0 comments on commit f275b56

Please sign in to comment.