#10834 closed defect (fixed)
Internal Error when submitting a review
Reported by: | Owned by: | Scott | |
---|---|---|---|
Priority: | normal | Component: | CodeReviewerPlugin |
Severity: | normal | Keywords: | |
Cc: | Scott | Trac Release: | 1.0 |
Description (last modified by )
I'm using Trac 1.0, via Apache. Installation seems to go well and differences on the changesets are shown, but when I try to submit a review on a changeset I get an internal error:
AttributeError: 'NoneType' object has no attribute 'get_changeset'
... = I substituted the path to the file.
We have multiple repositories set, but a default repository is defined.
I do not have that much experience with python, so any help would be appreciated.
How to Reproduce
While doing a POST operation on /changeset/141/moduletest/...
, Trac issued an internal error.
Request parameters:
{'__FORM_TOKEN': u'6cea3ac5ccb4e7227f291cfb', 'new': u'141', 'new_path': u'/moduletest/...', 'reviewbutton': u'Submit review', 'status': u'PASSED', 'summary': u''}
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
System Information
Trac | 1.0
|
Agilo | 1.3.9-pro
|
Genshi | 0.6 (without speedups)
|
Mercurial | 2.3.1
|
pysqlite | 2.6.0
|
Python | 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
|
setuptools | 0.6c11
|
SQLite | 3.6.21
|
jQuery | 1.7.2
|
Enabled Plugins
binary-agilo | 1.3.9-pro
|
tracaccountmanager | 0.4
|
traccodereviewer | 0.0.2
|
tracmercurial | 1.0.0.3dev
|
Python Traceback
Traceback (most recent call last): File "C:\Python27\lib\site-packages\trac\web\main.py", line 497, in _dispatch_request dispatcher.dispatch(req) File "C:\Python27\lib\site-packages\trac\web\main.py", line 224, in dispatch self._post_process_request(req, *resp) File "C:\Python27\lib\site-packages\trac\web\main.py", line 338, in _post_process_request resp = f.post_process_request(req, *resp) File "build\bdist.win32\egg\coderev\web_ui.py", line 59, in post_process_request tickets = self._update_tickets(req, review) File "build\bdist.win32\egg\coderev\web_ui.py", line 127, in _update_tickets changeset = repo.get_changeset(review.changeset) AttributeError: 'NoneType' object has no attribute 'get_changeset'
Attachments (0)
Change History (11)
comment:1 Changed 12 years ago by
Description: | modified (diff) |
---|
comment:2 Changed 12 years ago by
comment:4 Changed 11 years ago by
Cc: | Scott added; anonymous removed |
---|
comment:5 Changed 11 years ago by
This patch worked for me:
-
codereviewerplugin/0.12/coderev/web_ui.py
diff --git a/codereviewerplugin/0.12/coderev/web_ui.py b/codereviewerplugin/0.12/coderev/web_ui.py index 5e22e11..e2de454 100644
a b class CodeReviewerModule(Component): 122 122 comment += " for [%(_ref)s]:\n\n%(summary)s" % summary 123 123 124 124 # find and update tickets 125 # TODO: handle when there's no explicitly named repo 126 repo = RepositoryManager(self.env).get_repository(review.repo) 125 rm = RepositoryManager(self.env) 126 new_path = req.args.get('new_path') 127 reponame = req.args.get('reponame') 128 if reponame: 129 repo = rm.get_repository(reponame) 130 else: 131 reponame, repo, new_path = rm.get_repository_by_path(new_path) 127 132 changeset = repo.get_changeset(review.changeset) 128 133 ticket_re = CommitTicketUpdater.ticket_re 129 134 tickets = ticket_re.findall(changeset.message)
comment:6 follow-up: 7 Changed 11 years ago by
I haven't been able to reproduce. Could you describe how the repository is configured?
- Is the repository defined in trac.ini, or through the web administration page and stored in the database?
- Do you have multiple repositories defined? If so, does the issue only occur for some repositories? Does it occur for the default repository?
I was a bit confused by the patch in comment:5, so I edited it. Does it look correct to you now?
comment:7 Changed 11 years ago by
Replying to rjollos:
Here are the relevant trac.ini entries:
repository_dir = /sysadm/svn/svip/vlab_svip_ocp repository_sync_per_request = (default) repository_type = svn
We are using the system httpd with multiple Trac instances, but only one repository for each instance. I have only tried the plugin on this instance.
The edited comment:5 patch looks correct.
The patch is based on this code in changeset.py: nullege.com
comment:8 Changed 11 years ago by
Owner: | changed from Rob Guttman to Ryan J Ollos |
---|---|
Status: | new → accepted |
comment:10 Changed 11 years ago by
Owner: | changed from Ryan J Ollos to Scott |
---|
I have some error.