Permalink
Browse files

Converted setting empty cache to a load hook.

  • Loading branch information...
1 parent e6bd1cb commit 0190f88bb3dec6d8fc571b6baf22a2c6b9929260 Branko Vukelic committed Jan 9, 2010
Showing with 5 additions and 3 deletions.
  1. +2 −2 authenticationpy/__init__.py
  2. +3 −1 authenticationpy/test_auth.py
@@ -1,6 +1,6 @@
import web
-# Set empty cache if not already set
-if not hasattr(web.ctx, 'auth_user_cache'):
+def user_cache_hook():
+ # Set empty cache if not already set
web.ctx.auth_user_cache = {}
@@ -9,7 +9,7 @@
web.config.authmail = {'sender': 'admin@mysite.com',
'activation_subject': 'MySite.com Activation E-Mail',}
-from authenticationpy import auth
+from authenticationpy import user_cache_hook, auth
from authenticationpy import authforms
invalid_usernames = (
@@ -25,6 +25,8 @@
'@double@atmark@server.com',
)
+user_cache_hook()
+
def setup_table():
# create table for User object
database.query("""

0 comments on commit 0190f88

Please sign in to comment.