From 01dc4d131db91c31fb66d189d717e68b1aaebede Mon Sep 17 00:00:00 2001 From: Sean Auriti Date: Sun, 28 Aug 2016 14:31:50 -0400 Subject: [PATCH] Activity stream for issues #6 --- website/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/website/views.py b/website/views.py index 17535edc1..0810bf849 100644 --- a/website/views.py +++ b/website/views.py @@ -9,6 +9,13 @@ from django.contrib import messages from django.http import Http404 from actstream.models import Action, user_stream +from actstream import action +from django.contrib.auth.models import User +from actstream import registry +from website.models import Issue + +registry.register(User) +registry.register(Issue) def index(request, template="index.html"): activities = Action.objects.all()[0:10] @@ -28,6 +35,7 @@ def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() + action.send(self.request.user, verb='entered issue', target=obj) messages.success(self.request, 'Issue added! +1 point!') return HttpResponseRedirect("/")