From 595a690473d1b36010abb3b7cb59feca5c972848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 10 Nov 2016 09:50:10 +0100 Subject: [PATCH] Removed activity 'extra fields', as it wasn't used and half-built. --- pillar/api/activities.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pillar/api/activities.py b/pillar/api/activities.py index efc7ffd7..5496c152 100644 --- a/pillar/api/activities.py +++ b/pillar/api/activities.py @@ -158,7 +158,8 @@ def activity_object_add(actor_user_id, verb, object_type, object_id, def register_activity(actor_user_id, verb, object_type, object_id, context_object_type, context_object_id, - project_id=None, **extra_fields): + project_id=None, + node_type=None): """Registers an activity. This works using the following pattern: @@ -174,6 +175,7 @@ def register_activity(actor_user_id, verb, object_type, object_id, :param context_object_id: :param project_id: optional project ID to make the activity easily queryable per project. + :param node_type: optional, node type of the node receiving the activity. :returns: tuple (info, status_code), where a successful operation should have status_code=201. If it is not 201, a warning is logged. @@ -188,13 +190,14 @@ def register_activity(actor_user_id, verb, object_type, object_id, 'context_object': context_object_id} if project_id: activity['project'] = project_id - activity.update(extra_fields) + if node_type: + activity['node_type'] = node_type info, _, _, status_code = current_app.post_internal('activities', activity) if status_code != 201: - log.warning('register_activity: code %i creating activity %s: %s', - status_code, activity, info) + log.error('register_activity: code %i creating activity %s: %s', + status_code, activity, info) else: log.info('register_activity: user %s %s on %s %s, context %s %s', actor_user_id, verb, object_type, object_id,