Commits

Alen Mujezinovic  committed bfd3a84

Changed substitution to short dict syntax

  • Participants
  • Parent commits 73c4eb3

Comments (0)

Files changed (1)

File redis_sessions/backends/redis.py

     """
 
     def exists(self, session_key):
-        if db.exists(SESSION_KEY % dict(session_key = session_key)):
+        if db.exists(SESSION_KEY % {'session_key': session_key}):
             return True
         return False
 
             func = db.setnx
         else:
             func = db.set
-        key = SESSION_KEY % dict(session_key = self.session_key)
+        key = SESSION_KEY % {'session_key': self.session_key}
         result = func(
                 key,
                 self.encode(self._get_session(no_load=must_create)))
     def delete(self, session_key=None):
         if session_key is None:
             session_key = self.session_key
-        db.delete(SESSION_KEY % dict(session_key = session_key))
+        db.delete(SESSION_KEY % {'session_key': session_key})
 
     def load(self):
-        session_data = db.get(SESSION_KEY % dict(session_key = self.session_key))
+        session_data = db.get(SESSION_KEY % {'session_key': self.session_key})
         if session_data is None:
             self.create()
             return {}