h-shibuya commited on
Commit
16f72a1
·
verified ·
1 Parent(s): 5aae33c

Update public_src/app.py

Browse files
Files changed (1) hide show
  1. public_src/app.py +5 -5
public_src/app.py CHANGED
@@ -41,11 +41,11 @@ app.add_middleware(SessionMiddleware, secret_key=APP_SECRET_KEY, https_only=True
41
  class ResetSessionMiddleware(BaseHTTPMiddleware):
42
  async def dispatch(self, request, call_next):
43
  response = await call_next(request)
44
- if isinstance(request.session, dict):
45
- # セッションを辞書オブジェクトとして扱う場合の処理
46
- request.session['modified'] = True
47
- else:
48
- if request.session.get('user'):
49
  request.session.modified = True
50
  return response
51
 
 
41
  class ResetSessionMiddleware(BaseHTTPMiddleware):
42
  async def dispatch(self, request, call_next):
43
  response = await call_next(request)
44
+ if request.session.get('user'):
45
+ if isinstance(request.session, dict):
46
+ # セッションを辞書オブジェクトとして扱う場合の処理
47
+ request.session['modified'] = True
48
+ else:
49
  request.session.modified = True
50
  return response
51