allura
修訂 | 02c18ffcbcf43f32828301fee0827f0bd60a2c66 (tree) |
---|---|
時間 | 2012-06-29 00:18:49 |
作者 | Tim Van Steenburgh <tvansteenburgh@gmai...> |
Commiter | Tim Van Steenburgh |
[#4458] Updates in preparation for putting ActivityStream in prod.
1. Removed old follow and timeline controller methods (replaced by
2. Updated activitystream.enabled config param name to match the
Signed-off-by: Tim Van Steenburgh <tvansteenburgh@gmail.com>
@@ -280,7 +280,7 @@ class ProjectController(object): | ||
280 | 280 | @with_trailing_slash |
281 | 281 | def index(self, **kw): |
282 | 282 | mount = c.project.first_mount('read') |
283 | - activity_enabled = asbool(config.get('activity_stream.enabled', False)) | |
283 | + activity_enabled = asbool(config.get('activitystream.enabled', False)) | |
284 | 284 | if activity_enabled and c.project.app_instance('activity'): |
285 | 285 | redirect('activity/') |
286 | 286 | elif mount is not None: |
@@ -149,20 +149,3 @@ class UserProfileController(BaseController): | ||
149 | 149 | name=div['name'], |
150 | 150 | content=content)) |
151 | 151 | redirect('configuration') |
152 | - | |
153 | - @expose() | |
154 | - def follow(self, username=None, **kw): | |
155 | - user = User.by_username(username) | |
156 | - if not user: | |
157 | - flash('Invalid username.', 'error') | |
158 | - redirect('.') | |
159 | - director.connect(c.user, user) | |
160 | - flash('You are now following %s.' % username) | |
161 | - redirect('.') | |
162 | - | |
163 | - @expose('jinja:allura.ext.user_profile:templates/user_timeline.html') | |
164 | - def timeline(self, **kw): | |
165 | - username = c.project.shortname.split('/')[1] | |
166 | - user = User.by_username(username) | |
167 | - timeline = director.create_timeline(user) | |
168 | - return dict(timeline=timeline, user=user) |
@@ -64,12 +64,12 @@ class TestRootController(TestController): | ||
64 | 64 | assert len(response.html.findAll('a',{'href':'/adobe/adobe-2/'})) == 0 |
65 | 65 | |
66 | 66 | def test_project_redirect(self): |
67 | - with push_config(config, **{'activity_stream.enabled': 'false'}): | |
67 | + with push_config(config, **{'activitystream.enabled': 'false'}): | |
68 | 68 | resp = self.app.get('/p/test2/') |
69 | 69 | assert_equal(resp.status_int, 302) |
70 | 70 | assert_equal(resp.location, 'http://localhost/p/test2/admin/') |
71 | 71 | |
72 | - with push_config(config, **{'activity_stream.enabled': 'true'}): | |
72 | + with push_config(config, **{'activitystream.enabled': 'true'}): | |
73 | 73 | resp = self.app.get('/p/test2/') |
74 | 74 | assert_equal(resp.status_int, 302) |
75 | 75 | assert_equal(resp.location, 'http://localhost/p/test2/activity/') |
@@ -58,7 +58,7 @@ class ForgeActivityController(BaseController): | ||
58 | 58 | @expose('jinja:forgeactivity:templates/index.html') |
59 | 59 | @with_trailing_slash |
60 | 60 | def index(self, **kw): |
61 | - activity_enabled = asbool(config.get('activity_stream.enabled', False)) | |
61 | + activity_enabled = asbool(config.get('activitystream.enabled', False)) | |
62 | 62 | if not activity_enabled: |
63 | 63 | raise HTTPNotFound() |
64 | 64 |
@@ -72,7 +72,7 @@ class ForgeActivityController(BaseController): | ||
72 | 72 | @expose('json:') |
73 | 73 | @validate(W.follow_toggle) |
74 | 74 | def follow(self, follow, **kw): |
75 | - activity_enabled = asbool(config.get('activity_stream.enabled', False)) | |
75 | + activity_enabled = asbool(config.get('activitystream.enabled', False)) | |
76 | 76 | if not activity_enabled: |
77 | 77 | raise HTTPNotFound() |
78 | 78 |
@@ -13,17 +13,17 @@ from allura.lib.helpers import push_config | ||
13 | 13 | class TestActivityController(TestController): |
14 | 14 | def setUp(self, *args, **kwargs): |
15 | 15 | super(TestActivityController, self).setUp(*args, **kwargs) |
16 | - self._enabled = config.get('activity_stream.enabled', 'false') | |
17 | - config['activity_stream.enabled'] = 'true' | |
16 | + self._enabled = config.get('activitystream.enabled', 'false') | |
17 | + config['activitystream.enabled'] = 'true' | |
18 | 18 | |
19 | 19 | def tearDown(self, *args, **kwargs): |
20 | 20 | super(TestActivityController, self).tearDown(*args, **kwargs) |
21 | - config['activity_stream.enabled'] = self._enabled | |
21 | + config['activitystream.enabled'] = self._enabled | |
22 | 22 | |
23 | 23 | def test_index(self): |
24 | 24 | resp = self.app.get('/activity/') |
25 | 25 | assert 'Something happened.' in resp |
26 | 26 | |
27 | 27 | def test_index_disabled(self): |
28 | - config['activity_stream.enabled'] = 'false' | |
28 | + config['activitystream.enabled'] = 'false' | |
29 | 29 | resp = self.app.get('/activity/', status=404) |