aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/user_pages
diff options
context:
space:
mode:
authorJessica Tallon <jessica@megworld.co.uk>2014-10-07 10:01:38 +0100
committerJessica Tallon <jessica@megworld.co.uk>2014-10-07 10:01:38 +0100
commit9a1fc423ac298c2ddf078d91ea1302c135285781 (patch)
treec3a42caff8b46803a3af48cdd3afbdeb11427e29 /mediagoblin/user_pages
parent670cdef79c39262fa0844a91777b8c69751bab01 (diff)
parent2b1916182d36043c2dbce7c2718e8e1d1a976429 (diff)
downloadmediagoblin-9a1fc423ac298c2ddf078d91ea1302c135285781.tar.lz
mediagoblin-9a1fc423ac298c2ddf078d91ea1302c135285781.tar.xz
mediagoblin-9a1fc423ac298c2ddf078d91ea1302c135285781.zip
Merge branch '905-activities'
Add Activity and Generator models which allow for activities to be created. This now works with the feed API.
Diffstat (limited to 'mediagoblin/user_pages')
-rw-r--r--mediagoblin/user_pages/views.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mediagoblin/user_pages/views.py b/mediagoblin/user_pages/views.py
index 1f0b9dcd..b6cbcabd 100644
--- a/mediagoblin/user_pages/views.py
+++ b/mediagoblin/user_pages/views.py
@@ -28,6 +28,7 @@ from mediagoblin.tools.response import render_to_response, render_404, \
from mediagoblin.tools.text import cleaned_markdown_conversion
from mediagoblin.tools.translate import pass_to_ugettext as _
from mediagoblin.tools.pagination import Pagination
+from mediagoblin.tools.federation import create_activity
from mediagoblin.user_pages import forms as user_forms
from mediagoblin.user_pages.lib import (send_comment_email,
add_media_to_collection, build_report_object)
@@ -201,7 +202,7 @@ def media_post_comment(request, media):
_('Your comment has been posted!'))
trigger_notification(comment, media, request)
-
+ create_activity("post", comment, comment.author, target=media)
add_comment_subscription(request.user, media)
return redirect_obj(request, media)
@@ -263,6 +264,7 @@ def media_collect(request, media):
collection.creator = request.user.id
collection.generate_slug()
collection.save()
+ create_activity("create", collection, collection.creator)
# Otherwise, use the collection selected from the drop-down
else:
@@ -289,7 +291,7 @@ def media_collect(request, media):
% (media.title, collection.title))
else: # Add item to collection
add_media_to_collection(collection, media, form.note.data)
-
+ create_activity("add", media, request.user, target=collection)
messages.add_message(request, messages.SUCCESS,
_('"%s" added to collection "%s"')
% (media.title, collection.title))