Update references to request.authenticated_userid
Per warnings from Pyramid, old method will go away in 1.8
This commit is contained in:
parent
6bf60365ba
commit
2c27120eb4
|
@ -32,7 +32,6 @@ from rattail.db import model
|
|||
from rattail.db.auth import has_permission, administrator_role
|
||||
|
||||
from pyramid import threadlocal
|
||||
from pyramid.security import authenticated_userid
|
||||
|
||||
import tailbone
|
||||
from tailbone import helpers
|
||||
|
@ -120,7 +119,7 @@ def context_found(event):
|
|||
request = event.request
|
||||
|
||||
request.user = None
|
||||
uuid = authenticated_userid(request)
|
||||
uuid = request.authenticated_userid
|
||||
if uuid:
|
||||
request.user = Session.query(model.User).get(uuid)
|
||||
if request.user:
|
||||
|
|
|
@ -30,7 +30,7 @@ from rattail.db.auth import authenticate_user, set_user_password
|
|||
|
||||
import formencode
|
||||
from pyramid.httpexceptions import HTTPFound
|
||||
from pyramid.security import remember, forget, authenticated_userid
|
||||
from pyramid.security import remember, forget
|
||||
from pyramid_simpleform import Form
|
||||
from webhelpers.html import literal
|
||||
from webhelpers.html import tags
|
||||
|
@ -47,7 +47,7 @@ def forbidden(request):
|
|||
appropriate view.
|
||||
"""
|
||||
msg = literal("You do not have permission to do that.")
|
||||
if not authenticated_userid(request):
|
||||
if not request.authenticated_userid:
|
||||
msg += literal(" (Perhaps you should %s?)" %
|
||||
tags.link_to("log in", request.route_url('login')))
|
||||
# Store current URL in session, for smarter redirect after login.
|
||||
|
|
Loading…
Reference in a new issue