• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

allura


Commit MetaInfo

Revisione2b0ffd58cb4d79c4cf63cdae60d7637738f8b8c (tree)
Time2012-06-28 18:39:27
AuthorIgor Bondarenko <jetmind2@gmai...>
CommiterIgor Bondarenko

Log Message

[#4457] ticket:95 Fix has_home_tool() implementation.

Check by tool type, not by mount_point.

Change Summary

Incremental Difference

--- a/Allura/allura/model/neighborhood.py
+++ b/Allura/allura/model/neighborhood.py
@@ -111,7 +111,8 @@ class Neighborhood(MappedClass):
111111
112112 @property
113113 def has_home_tool(self):
114- return self.neighborhood_project.app_config('home') is not None
114+ return (self.neighborhood_project
115+ .app_config_by_tool_type('home') is not None)
115116
116117 @property
117118 def icon(self):
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -514,6 +514,11 @@ class Project(MappedClass):
514514 'project_id':self._id,
515515 'options.mount_point':mount_point}).first()
516516
517+ def app_config_by_tool_type(self, tool_type):
518+ return AppConfig.query.find({
519+ 'project_id': self._id,
520+ 'tool_name': tool_type}).first()
521+
517522 def new_subproject(self, name, install_apps=True, user=None):
518523 if not h.re_path_portion.match(name):
519524 raise exceptions.ToolError, 'Mount point "%s" is invalid' % name