I am already using Pyramid auth, but to bend it for the new feature I'd have to edit _every_ add_view(), which will make it an even worse hack than my current tween hack, where I need to manually recreate the attributes used in the template, notably the missing matched_route --
def signup_hack_tween_factory(handler, registry):
def signup_hack_tween(request):
if request.user and not request.user.user_name and request.method == 'POST':
request.c['h'] = helpers
request.matched_route = Mock()
settings = registry.settings
request.RedisCache = settings['RedisCache']
return render_to_response('templates/signup_hack.genshi', request.c, request)
else:
try:
response = handler(request)
finally:
return response
return signup_hack_tween
Jerry