소스 검색

HUE-9708 [Django Upgrade] RemovedInDjango21Warning: The logout() view is superseded by the class-based LogoutView()

ayush.goyal 4 년 전
부모
커밋
0fdf1b8508
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      desktop/core/src/desktop/auth/views.py

+ 1 - 1
desktop/core/src/desktop/auth/views.py

@@ -260,7 +260,7 @@ def dt_logout(request, next_page=None):
   if len([backend for backend in backends if hasattr(backend, 'logout')]) == len(backends):
     LOG.warn("Failed to log out from all backends for user: %s" % (username))
 
-  response = django.contrib.auth.views.logout(request, next_page)
+  response = django.contrib.auth.views.LogoutView.as_view(next_page=next_page)(request)
   response.delete_cookie(LOAD_BALANCER_COOKIE)
   return response