Removed activity 'extra fields', as it wasn't used and half-built.

This commit is contained in:
2016-11-10 09:50:10 +01:00
parent 1702b40812
commit 595a690473

View File

@@ -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, def register_activity(actor_user_id, verb, object_type, object_id,
context_object_type, context_object_id, context_object_type, context_object_id,
project_id=None, **extra_fields): project_id=None,
node_type=None):
"""Registers an activity. """Registers an activity.
This works using the following pattern: 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 context_object_id:
:param project_id: optional project ID to make the activity easily queryable :param project_id: optional project ID to make the activity easily queryable
per project. 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 :returns: tuple (info, status_code), where a successful operation should have
status_code=201. If it is not 201, a warning is logged. status_code=201. If it is not 201, a warning is logged.
@@ -188,12 +190,13 @@ def register_activity(actor_user_id, verb, object_type, object_id,
'context_object': context_object_id} 'context_object': context_object_id}
if project_id: if project_id:
activity['project'] = 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) info, _, _, status_code = current_app.post_internal('activities', activity)
if status_code != 201: if status_code != 201:
log.warning('register_activity: code %i creating activity %s: %s', log.error('register_activity: code %i creating activity %s: %s',
status_code, activity, info) status_code, activity, info)
else: else:
log.info('register_activity: user %s %s on %s %s, context %s %s', log.info('register_activity: user %s %s on %s %s, context %s %s',