jumpserver cas认证last_login 无法更新

2024-11-08 21:29:17 [INFO] Check oracle ports (MAGNUS_ORACLE_PORTS)
2024-11-08 21:29:32 [INFO] Try using auth backend: <rbac.backends.RBACBackend object at 0x7f73a8353850>
2024-11-08 21:29:32 [INFO] Try using auth backend: <authentication.backends.base.JMSModelBackend object at 0x7f73a848b790>
2024-11-08 21:29:32 [INFO] Try using auth backend: <authentication.backends.pubkey.PublicKeyAuthBackend object at 0x7f73a8489210>
2024-11-08 21:29:32 [INFO] Try using auth backend: <authentication.backends.ldap.LDAPAuthorizationBackend object at 0x7f73a846fbd0>
2024-11-08 21:29:32 [INFO] Authentication LDAP backend
2024-11-08 21:29:32 [INFO] No username or password
2024-11-08 21:29:32 [INFO] Try using auth backend: <authentication.backends.cas.backends.CASBackend object at 0x7f73a8353f90>
2024-11-08 21:29:32 [DEBU] User login success: xxx
2024-11-08 21:29:32 [ERRO] Internal Server Error: /core/auth/cas/login/
Traceback (most recent call last):
File “/opt/py3/lib/python3.11/site-packages/asgiref/sync.py”, line 518, in thread_handler
raise exc_info[1]
File “/opt/py3/lib/python3.11/site-packages/django/core/handlers/exception.py”, line 43, in inner
response = await get_response(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/asgiref/sync.py”, line 518, in thread_handler
raise exc_info[1]
File “/opt/py3/lib/python3.11/site-packages/django/core/handlers/base.py”, line 253, in _get_response_async
response = await wrapped_callback(
^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/asgiref/sync.py”, line 468, in call
ret = await asyncio.shield(exec_coro)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/asgiref/current_thread_executor.py”, line 40, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/asgiref/sync.py”, line 522, in thread_handler
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.11/contextlib.py”, line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/views/generic/base.py”, line 103, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/utils/decorators.py”, line 46, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/views/decorators/csrf.py”, line 55, in wrapped_view
return view_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django_cas_ng/views.py”, line 72, in dispatch
return super().dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/views/generic/base.py”, line 142, in dispatch
return handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/jumpserver/apps/authentication/backends/cas/views.py”, line 16, in get
response = super().get(request)
^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django_cas_ng/views.py”, line 133, in get
auth_login(request, user)
File “/opt/py3/lib/python3.11/site-packages/django/contrib/auth/init.py”, line 144, in login
user_logged_in.send(sender=user.class, request=request, user=user)
File “/opt/py3/lib/python3.11/site-packages/django/dispatch/dispatcher.py”, line 176, in send
return [
^
File “/opt/py3/lib/python3.11/site-packages/django/dispatch/dispatcher.py”, line 177, in
(receiver, receiver(signal=self, sender=sender, **named))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/contrib/auth/models.py”, line 23, in update_last_login
user.save(update_fields=[“last_login”])
File “/opt/jumpserver/apps/users/models/user/init.py”, line 241, in save
return super().save(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/contrib/auth/base_user.py”, line 69, in save
super().save(*args, **kwargs)
File “/opt/py3/lib/python3.11/site-packages/django/db/models/base.py”, line 812, in save
self.save_base(
File “/opt/py3/lib/python3.11/site-packages/django/db/models/base.py”, line 863, in save_base
updated = self._save_table(
^^^^^^^^^^^^^^^^^
File “/opt/py3/lib/python3.11/site-packages/django/db/models/base.py”, line 982, in _save_table
raise DatabaseError(“Save with update_fields did not affect any rows.”)

数据库last_login也是空值

什么版本,提一下issue吧

改了users的signal逻辑可以了