def activity_create(context, activity_dict, **kw):
 _check_access('activity_create', context, activity_dict)
 if ('ignore_auth' in kw):
  raise Exception('Activity Stream calling parameters have changed ignore_auth must be passed in the context not as a param')
 if (not paste.deploy.converters.asbool(config.get('ckan.activity_streams_enabled', 'true'))):
  return
 model = context['model']
 if getattr(model.Session, 'revision', None):
  activity_dict['revision_id'] = model.Session.revision.id
 else:
  activity_dict['revision_id'] = None
 schema = (context.get('schema') or ckan.logic.schema.default_create_activity_schema())
 (data, errors) = _validate(activity_dict, schema, context)
 if errors:
  raise ValidationError(errors)
 activity = model_save.activity_dict_save(data, context)
 if (not context.get('defer_commit')):
  model.repo.commit()
 log.debug(("Created '%s' activity" % activity.activity_type))
 return model_dictize.activity_dictize(activity, context)

def activity_create ( context , activity_dict , ** kw ) : _check_access ( 'activity_create' , context , activity_dict ) if ( 'ignore_auth' in kw ) : raise Exception ( 'Activity Stream calling parameters have changed ignore_auth must be passed in the context not as a param' ) if ( not paste . deploy . converters . asbool ( config . get ( 'ckan.activity_streams_enabled' , 'true' ) ) ) : return model = context [ 'model' ] if getattr ( model . Session , 'revision' , None ) : activity_dict [ 'revision_id' ] = model . Session . revision . id else : activity_dict [ 'revision_id' ] = None schema = ( context . get ( 'schema' ) or ckan . logic . schema . default_create_activity_schema ( ) ) ( data , errors ) = _validate ( activity_dict , schema , context ) if errors : raise ValidationError ( errors ) activity = model_save . activity_dict_save ( data , context ) if ( not context . get ( 'defer_commit' ) ) : model . repo . commit ( ) log . debug ( ( "Created '%s' activity" % activity . activity_type ) ) return model_dictize . activity_dictize ( activity , context )
create a new activity stream activity .