Looking up g.portfolio when g.current_user is None raises an error

This commit is contained in:
George Drummond 2019-05-17 13:29:40 -04:00
parent b71402955c
commit 15d4b48184
No known key found for this signature in database
GPG Key ID: 296DD6077123BF17

View File

@ -96,7 +96,9 @@ def user_can_view(permission):
def portfolio():
if g.portfolio is not None:
if g.current_user is None:
return {}
elif g.portfolio is not None:
active_task_orders = [
task_order for task_order in g.portfolio.task_orders if task_order.is_active
]