Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

import logging 

 

from pyramid.view import view_config 

 

from bookie.lib.access import ReqAuthorize 

from bookie.models.auth import UserMgr 

 

LOG = logging.getLogger(__name__) 

 

 

@view_config(route_name="user_account", renderer="/accounts/index.mako") 

def account(request): 

    """Index of account page 

 

    You can only load your own account page. If you try to view someone else's 

    you'll just end up with your own. 

 

    """ 

    # if auth fails, it'll raise an HTTPForbidden exception 

    with ReqAuthorize(request): 

        user = UserMgr.get(username=request.user.username) 

 

        return { 

            'user': user, 

            'username': user.username, 

        }