From 34b95116dc3a07fac2a9c8bb46bbede67fca9dd4 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Fri, 22 Apr 2016 18:48:28 +0200 Subject: [PATCH] Tweak comment ownership --- pillar/application/utils/activities.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pillar/application/utils/activities.py b/pillar/application/utils/activities.py index 1d0495d1..22be6d41 100644 --- a/pillar/application/utils/activities.py +++ b/pillar/application/utils/activities.py @@ -28,8 +28,11 @@ def notification_parse(notification): else: parent_comment_user = users_collection.find_one( {'_id': node['parent']['user']}) - owner = "{0}'s {1}".format(parent_comment_user['username'], - node['parent']['node_type']) + if parent_comment_user['_id'] == node['user']: + user_name = 'their' + else: + user_name = "{0}'s".format(parent_comment_user['username']) + owner = "{0} {1}".format(user_name, node['parent']['node_type']) context_object_type = node['parent']['node_type'] context_object_name = owner