From 5d1a8815d12592d575816dec6212820e57303d3f Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Sun, 24 Mar 2013 15:39:49 -0400 Subject: [PATCH] Set a starting value for session.send_new_cookie. This makes session.__init__ slightly more complicated but probably simplifies everything else, especially if we make the class smarter later by having it track changes itself. --- mediagoblin/tools/session.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mediagoblin/tools/session.py b/mediagoblin/tools/session.py index 303907b9..da53ddf0 100644 --- a/mediagoblin/tools/session.py +++ b/mediagoblin/tools/session.py @@ -22,11 +22,15 @@ import crypto _log = logging.getLogger(__name__) class Session(dict): + def __init__(self, *args, **kwargs): + self.send_new_cookie = False + dict.__init__(self, *args, **kwargs) + def save(self): self.send_new_cookie = True def is_updated(self): - return getattr(self, 'send_new_cookie') + return self.send_new_cookie def delete(self): self.clear() -- 2.25.1