#4385 Add director.create_activity() calls for more events

v1.0.0
closed
General
Cory Johns
2015-08-20
2012-06-15
No

Any time an event happens that we want to appear in the activity stream, we need to call director.create_activity(...). See the save_ticket() method in tracker_main.py on forge:tv/timelines for an example:

director.create_activity(c.user, 'created', ticket, target=c.project)

See also FeedItem.add() lines for re-use/refactor

Discussion

  • Dave Brondsema

    Dave Brondsema - 2012-06-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,3 +1,5 @@
     Any time an event happens that we want to appear in the activity stream, we need to call `director.create_activity(...)`. See the `save_ticket()` method in `tracker_main.py` on forge:tv/timelines for an example:
    
         director.create_activity(c.user, 'created', ticket, target=c.project)
    +
    +See also FeedItem.add() lines for re-use/refactor
    
    • size: --> 2
     
  • Tim Van Steenburgh

    • status: open --> in-progress
    • assigned_to: Tim Van Steenburgh
     
  • Tim Van Steenburgh

    • status: in-progress --> code-review
    • qa: Cory Johns
     
  • Tim Van Steenburgh

    forge:tv/4385

    1. Make sure https://trac.geek.net/trac/siteops/ticket/51627 is closed (installs new version of ActivityStream package on sandboxes). (Or, install it manually.)
    2. cd /var/local/allura && pip install -r requirements-sf.txt
    3. Register a new user on your sandbox (verification email sent to sfpy sandbox). Logged in as your new user, 'follow' the admin1 user.
    4. Log in as admin1 and do stuff that creates activities:
    5. Create/edit ticket
    6. Post/edit a comment (anywhere)
    7. Create/edit a wiki page
    8. Create/edit a blog post
    9. Logged in as your new user, go to your activity page and see admin1's activities in your timeline.
    10. `/var/local/allura/run_tests

    The timeline display is there simply as a sanity check that activities are being created. It will be improved in other tickets.

     
  • Cory Johns

    Cory Johns - 2012-08-06
    • status: code-review --> closed
     

Log in to post a comment.