mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-28 07:47:10 +00:00
[Update] 解决select_for_update的错误
This commit is contained in:
parent
371aff3251
commit
b5962a098a
@ -38,12 +38,12 @@ class SessionViewSet(OrgBulkModelViewSet):
|
|||||||
('date_start', ('date_from', 'date_to'))
|
('date_start', ('date_from', 'date_to'))
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_object(self):
|
def filter_queryset(self, queryset):
|
||||||
|
queryset = super().filter_queryset(queryset)
|
||||||
# 解决guacamole更新session时并发导致幽灵会话的问题
|
# 解决guacamole更新session时并发导致幽灵会话的问题
|
||||||
obj = super().get_object()
|
if self.request.method in ('PATCH',):
|
||||||
if self.request.method in ('PATCH', ):
|
queryset = queryset.select_for_update()
|
||||||
obj = obj.select_for_update()
|
return queryset
|
||||||
return obj
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def filter_backends(self):
|
def filter_backends(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user