• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

修订版8e0face292a005df91ea2f58c34c2d10f4e20d2f (tree)
时间2012-06-27 23:34:48
作者Jenny Steele <jsteele@geek...>
CommiterDave Brondsema

Log Message

[#4448] Removed neighborhood caching and instead started querying just the requested neighborhood

更改概述

差异

--- a/Allura/allura/command/create_neighborhood.py
+++ b/Allura/allura/command/create_neighborhood.py
@@ -25,7 +25,6 @@ class CreateNeighborhoodCommand(base.Command):
2525 google_analytics = False))
2626 project_reg = plugin.ProjectRegistrationProvider.get()
2727 project_reg.register_neighborhood_project(n, admins)
28- print "WARNING! You must restart the webserver before you can use the new neighborhood."
2928
3029
3130 class UpdateNeighborhoodCommand(base.Command):
--- a/Allura/allura/controllers/root.py
+++ b/Allura/allura/controllers/root.py
@@ -40,40 +40,34 @@ class W:
4040 class RootController(WsgiDispatchController):
4141 """
4242 The root controller for the allura application.
43-
43+
4444 All the other controllers and WSGI applications should be mounted on this
4545 controller. For example::
46-
46+
4747 panel = ControlPanelController()
4848 another_app = AnotherWSGIApplication()
49-
49+
5050 Keep in mind that WSGI applications shouldn't be mounted directly: They
5151 must be wrapped around with :class:`tg.controllers.WSGIAppController`.
52-
52+
5353 """
54-
54+
5555 auth = AuthController()
5656 error = ErrorController()
5757 nf = NewForgeController()
5858 nf.admin = SiteAdminController()
5959 search = SearchController()
6060 rest = RestController()
61- neighborhoods_bound = False
6261
6362 def __init__(self):
64- if not self.neighborhoods_bound:
65- self.bind_controllers()
63+ n_url_prefix = '/%s/' % request.path.split('/')[1]
64+ n = M.Neighborhood.query.get(url_prefix=n_url_prefix)
65+ if n and not n.url_prefix.startswith('//'):
66+ n.bind_controller(self)
6667 self.browse = ProjectBrowseController()
6768 self.allura_sitemap = SitemapIndexController()
6869 super(RootController, self).__init__()
6970
70- @classmethod
71- def bind_controllers(cls):
72- for n in M.Neighborhood.query.find():
73- if n.url_prefix.startswith('//'): continue
74- n.bind_controller(cls)
75- cls.neighborhoods_bound = True
76-
7771 def _setup_request(self):
7872 c.project = c.app = None
7973 c.memoize_cache = {}
--- a/Allura/allura/model/neighborhood.py
+++ b/Allura/allura/model/neighborhood.py
@@ -41,6 +41,7 @@ class Neighborhood(MappedClass):
4141 class __mongometa__:
4242 session = main_orm_session
4343 name = 'neighborhood'
44+ unique_indexes = [ 'url_prefix' ]
4445
4546 _id = FieldProperty(S.ObjectId)
4647 name = FieldProperty(str)