Browse Source

HUE-2436 [useradmin] Django-1.6: Stop caching the user in the session

This process of caching the user object in the session no longer works.
Since we don't ever actually access this cached user, we can just store
a boolean to mark that we've imported this user.
Erick Tryzelaar 11 years ago
parent
commit
e965d3ed1b
1 changed files with 4 additions and 1 deletions
  1. 4 1
      apps/useradmin/src/useradmin/middleware.py

+ 4 - 1
apps/useradmin/src/useradmin/middleware.py

@@ -52,5 +52,8 @@ class LdapSynchronizationMiddleware(object):
         connection = ldap_access.get_connection_from_server(next(LDAP.LDAP_SERVERS.__iter__()))
         connection = ldap_access.get_connection_from_server(next(LDAP.LDAP_SERVERS.__iter__()))
       else:
       else:
         connection = ldap_access.get_connection_from_server()
         connection = ldap_access.get_connection_from_server()
-      request.session[self.USER_CACHE_NAME] = import_ldap_users(connection, user.username, sync_groups=True, import_by_dn=False)
+
+      import_ldap_users(connection, user.username, sync_groups=True, import_by_dn=False)
+
+      request.session[self.USER_CACHE_NAME] = True
       request.session.modified = True
       request.session.modified = True