[Update] 刷新session有效期

pull/2978/head
ibuler 2019-07-17 12:54:00 +08:00
parent 4d1da1d292
commit 12b2f2f499
2 changed files with 5 additions and 2 deletions

View File

@ -56,4 +56,6 @@ class RequestMiddleware:
def __call__(self, request):
set_current_request(request)
response = self.get_response(request)
age = request.session.get_expiry_age()
request.session.set_expiry(age)
return response

View File

@ -25,7 +25,8 @@ class OrgMiddleware:
def __call__(self, request):
self.set_permed_org_if_need(request)
org = get_org_from_request(request)
request.current_org = org
set_current_org(org)
if org is not None:
request.current_org = org
set_current_org(org)
response = self.get_response(request)
return response