X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/490b45cdc311a09db0266a3f974289e3979bf2ea..d2cfab09f98980d5c1d433a9e75eb65e0b13b0aa:/floof/controllers/users.py?ds=inline diff --git a/floof/controllers/users.py b/floof/controllers/users.py index 7c24c0f..4c9bb9c 100644 --- a/floof/controllers/users.py +++ b/floof/controllers/users.py @@ -27,11 +27,12 @@ class UsersController(BaseController): except NoResultFound: abort(404) - rels = UserRelationship.query.filter_by( - user_id=c.user.id, - target_user_id=c.this_user.id, - ).all() + if c.user: + rels = UserRelationship.query.filter_by( + user_id=c.user.id, + target_user_id=c.this_user.id, + ).all() - c.relationships = [_.type for _ in rels] + c.relationships = [_.type for _ in rels] return render('/users/view.mako')