Allow extra fields in activities.

This commit is contained in:
Sybren A. Stüvel 2016-10-12 14:29:28 +02:00
parent ade62033ba
commit 0146b568c0
2 changed files with 7 additions and 1 deletions

View File

@ -153,7 +153,7 @@ 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):
project_id=None, **extra_fields):
"""Registers an activity.
This works using the following pattern:
@ -183,6 +183,7 @@ 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)
info, _, _, status_code = current_app.post_internal('activities', activity)

View File

@ -684,6 +684,11 @@ activities_schema = {
},
'required': False,
},
# If the object type is 'node', the node type can be stored here.
'node_type': {
'type': 'string',
'required': False,
}
}
notifications_schema = {