|
@@ 371-389 (lines=19) @@
|
| 368 |
|
return HTTPFound(location=request.route_url('user_pools')) |
| 369 |
|
|
| 370 |
|
|
| 371 |
|
@view_config(route_name='user_pool', |
| 372 |
|
renderer='templates/user/pool.jinja2', |
| 373 |
|
permission='user') |
| 374 |
|
def user_pool(request): |
| 375 |
|
try: |
| 376 |
|
pool = Pool.from_id(request.matchdict['pool_id']) |
| 377 |
|
if pool.owner != request.user.id: |
| 378 |
|
request.session.flash('You do not have permission to view that pool.', 'error') |
| 379 |
|
return HTTPFound(location=request.route_url('user_pools')) |
| 380 |
|
|
| 381 |
|
r = transaction_history_queries(request, pool) |
| 382 |
|
r['user'] = request.user |
| 383 |
|
r['pool'] = pool |
| 384 |
|
|
| 385 |
|
return r |
| 386 |
|
except Exception as e: |
| 387 |
|
if request.debug: raise(e) |
| 388 |
|
request.session.flash('Could not load pool.', 'error') |
| 389 |
|
return HTTPFound(location=request.route_url('user_pools')) |
| 390 |
|
|
| 391 |
|
|
| 392 |
|
@view_config(route_name='user_pool_addmember_submit', |
|
@@ 467-478 (lines=12) @@
|
| 464 |
|
return {} |
| 465 |
|
|
| 466 |
|
|
| 467 |
|
@view_config(route_name='user_password_edit_submit', |
| 468 |
|
request_method='POST', |
| 469 |
|
permission='user') |
| 470 |
|
def user_password_edit_submit(request): |
| 471 |
|
pwd0 = request.POST['edit-password-0'] |
| 472 |
|
pwd1 = request.POST['edit-password-1'] |
| 473 |
|
if pwd0 != pwd1: |
| 474 |
|
request.session.flash('Error: Passwords do not match', 'error') |
| 475 |
|
return HTTPFound(location=request.route_url('user_password_edit')) |
| 476 |
|
request.user.password = pwd0 |
| 477 |
|
request.session.flash('Password changed successfully.', 'success') |
| 478 |
|
return HTTPFound(location=request.route_url('user_index')) |
| 479 |
|
# check that changing password for actually logged in user |
| 480 |
|
|
| 481 |
|
|