diff options
author | Aaron Bentley <aaron.bentley@utoronto.ca> | 2006-04-11 19:23:03 -0400 |
---|---|---|
committer | Aaron Bentley <aaron.bentley@utoronto.ca> | 2006-04-11 19:23:03 -0400 |
commit | e9d18ea441fbc7d2aa2f769a7eba129e5f132518 (patch) | |
tree | 511e1f632c07e0d4cf197e1cf9da012be93ba44f | |
parent | 881d1ce81bc97d53f44997ff7a0198717b754df2 (diff) | |
parent | 3edaf3974b197c89189803b2f99834fd8d735c64 (diff) | |
download | bugseverywhere-e9d18ea441fbc7d2aa2f769a7eba129e5f132518.tar.gz |
Merge with other be
-rw-r--r-- | .bzrignore | 2 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/PKG-INFO | 15 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO | 16 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/app.cfg | 16 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/controllers.py | 4 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/model.py | 7 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/templates/bugs.kid | 3 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/beweb/templates/edit_bug.kid | 3 | ||||
-rw-r--r-- | Bugs-Everywhere-Web/dev.cfg | 2 | ||||
-rw-r--r-- | libbe/restconvert.py | 17 |
10 files changed, 57 insertions, 28 deletions
@@ -1,2 +1,4 @@ Bugs-Everywhere-Web/beweb/config.py ./build +Bugs-Everywhere-Web/database.sqlite +Bugs-Everywhere-Web/beweb/catwalk-session diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/PKG-INFO b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/PKG-INFO deleted file mode 100644 index 6cb6ad2..0000000 --- a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/Bugs-Everywhere-Web.egg-info/PKG-INFO +++ /dev/null @@ -1,15 +0,0 @@ -Metadata-Version: 1.0 -Name: Bugs-Everywhere-Web -Version: 1.0 -Summary: UNKNOWN -Home-page: UNKNOWN -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: UNKNOWN -Platform: UNKNOWN -Classifier: Development Status :: 3 - Alpha -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Topic :: Software Development :: Libraries :: Python Modules -Classifier: Framework :: TurboGears diff --git a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO index 78b12a6..6cb6ad2 100644 --- a/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO +++ b/Bugs-Everywhere-Web/Bugs_Everywhere_Web.egg-info/PKG-INFO @@ -1 +1,15 @@ -Version: 0.0 +Metadata-Version: 1.0 +Name: Bugs-Everywhere-Web +Version: 1.0 +Summary: UNKNOWN +Home-page: UNKNOWN +Author: UNKNOWN +Author-email: UNKNOWN +License: UNKNOWN +Description: UNKNOWN +Platform: UNKNOWN +Classifier: Development Status :: 3 - Alpha +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Framework :: TurboGears diff --git a/Bugs-Everywhere-Web/beweb/app.cfg b/Bugs-Everywhere-Web/beweb/app.cfg index 0035ffb..024fa8a 100644 --- a/Bugs-Everywhere-Web/beweb/app.cfg +++ b/Bugs-Everywhere-Web/beweb/app.cfg @@ -31,7 +31,7 @@ # -------------- # Enable Visit tracking -# visit.on=False +visit.on=True # Number of minutes a visit may be idle before it expires. # visit.timeout=20 @@ -57,29 +57,29 @@ # -------- # Switch to turn on or off the Identity management module -# identity.on=False +identity.on=True # [REQUIRED] URL to which CherryPy will internally redirect when an access # control check fails. If Identity management is turned on, a value for this # option must be specified. -# identity.failure_url=None +identity.failure_url="/login" # The IdentityProvider to use -- defaults to the SqlObjectIdentityProvider which # pulls User, Group, and Permission data out of your model database. -# identity.provider="sqlobject" +identity.provider="sqlobject" # The names of the fields on the login form containing the visitor's user ID # and password. In addition, the submit button is specified simply so its # existence may be stripped out prior to passing the form data to the target # controller. -# identity.form.user_name="user_name" -# identity.form.password="password" -# identity.form.submit="login" +identity.form.user_name="user_name" +identity.form.password="password" +identity.form.submit="login" # What sources should the identity provider consider when determining the # identity associated with a request? Comma separated list of identity sources. # Valid sources: form, visit, http_auth -# identity.source="form,http_auth,visit" +identity.source="form,http_auth,visit" # SqlObjectIdentityProvider diff --git a/Bugs-Everywhere-Web/beweb/controllers.py b/Bugs-Everywhere-Web/beweb/controllers.py index 9231030..4417a63 100644 --- a/Bugs-Everywhere-Web/beweb/controllers.py +++ b/Bugs-Everywhere-Web/beweb/controllers.py @@ -23,6 +23,7 @@ class Comment(PrestHandler): bug_tree = project_tree(comment_data['project']) bug = bug_tree.get_bug(comment_data['bug']) comment = new_comment(bug, "") + comment.From = identity.current.user.userId comment.content_type = "text/restructured" comment.save() raise cherrypy.HTTPRedirect(comment_url(comment=comment.uuid, @@ -33,6 +34,7 @@ class Comment(PrestHandler): bug_tree = project_tree(comment_data['project']) bug = bug_tree.get_bug(comment_data['bug']) reply_comment = new_comment(bug, "") + reply_comment.From = identity.current.user.userId reply_comment.in_reply_to = comment.uuid reply_comment.save() reply_data = dict(comment_data) @@ -92,9 +94,11 @@ class Bug(PrestHandler): "search" : search, } + @identity.require( identity.has_permission("editbugs")) @provide_action("action", "New bug") def new_bug(self, bug_data, bug, **kwargs): bug = new_bug(project_tree(bug_data['project'])) + bug.creator = identity.current.user.userId bug.save() raise cherrypy.HTTPRedirect(bug_url(bug_data['project'], bug.uuid)) diff --git a/Bugs-Everywhere-Web/beweb/model.py b/Bugs-Everywhere-Web/beweb/model.py index e20d1ce..6a603bb 100644 --- a/Bugs-Everywhere-Web/beweb/model.py +++ b/Bugs-Everywhere-Web/beweb/model.py @@ -1,10 +1,15 @@ from sqlobject import * from turbogears.database import PackageHub # Uncomment the following line if you wish to use Identity and SO_Provider -# from turbogears.identity.soprovider import TG_User, TG_Group, TG_Permission +from turbogears.identity.soprovider import TG_User, TG_Group, TG_Permission +from turbogears import identity hub = PackageHub("beweb") __connection__ = hub +def people_map(): + return dict([(u.userId, u.displayName) for u in TG_User.select() if + "fixbugs" in identity.current.permissions]) + # class YourDataClass(SQLObject): # pass diff --git a/Bugs-Everywhere-Web/beweb/templates/bugs.kid b/Bugs-Everywhere-Web/beweb/templates/bugs.kid index b83a593..3271537 100644 --- a/Bugs-Everywhere-Web/beweb/templates/bugs.kid +++ b/Bugs-Everywhere-Web/beweb/templates/bugs.kid @@ -2,7 +2,8 @@ <?python from libbe.cmdutil import unique_name from beweb.controllers import bug_url, project_url, bug_list_url -from beweb.config import people +from beweb.model import people_map +people = people_map() def row_class(bug, num): if not bug.active is True: return "closed" diff --git a/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid b/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid index c31d660..34fcb99 100644 --- a/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid +++ b/Bugs-Everywhere-Web/beweb/templates/edit_bug.kid @@ -3,8 +3,9 @@ from libbe.bugdir import severity_levels, active_status, inactive_status, thread_comments from libbe.utility import time_to_str from beweb.controllers import bug_list_url, comment_url -from beweb.config import people from beweb.formatting import comment_body_xhtml, select_among +from beweb.model import people_map +people = people_map() ?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#" py:extends="'master.kid'"> diff --git a/Bugs-Everywhere-Web/dev.cfg b/Bugs-Everywhere-Web/dev.cfg index e985b4b..2d9433f 100644 --- a/Bugs-Everywhere-Web/dev.cfg +++ b/Bugs-Everywhere-Web/dev.cfg @@ -9,7 +9,7 @@ # pick the form for your database # sqlobject.dburi="postgres://username@hostname/databasename" # sqlobject.dburi="mysql://username:password@hostname:port/databasename" -# sqlobject.dburi="sqlite:///file_name_and_path" +sqlobject.dburi="sqlite:////home/abentley/be/be/Bugs-Everywhere-Web/database.sqlite" # if you are using a database or table type without transactions # (MySQL default, for example), you should turn off transactions diff --git a/libbe/restconvert.py b/libbe/restconvert.py index f93fcf6..8ebb6b4 100644 --- a/libbe/restconvert.py +++ b/libbe/restconvert.py @@ -1,3 +1,20 @@ +# Copyright (C) 2005, 2006 Aaron Bentley and Panometrics, Inc. +# <abentley@panoramicfeedback.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + import re from StringIO import StringIO from docutils import nodes |