Skip to content

Commit

Permalink
Activity stream for issues #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Auriti committed Aug 28, 2016
1 parent 55cb53c commit 01dc4d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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("/")

Expand Down

0 comments on commit 01dc4d1

Please sign in to comment.