Removed activity 'extra fields', as it wasn't used and half-built.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user