My favorites | Sign in
Project Home Wiki Issues
New issue   Search
for
  Advanced search   Search tips
Issue 1309: DashBoard: Using spaces for reviewers break review records
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  chip...@gmail.com
Closed:  Sep 2009


Sign in to add a comment
 
Reported by zoran.ra...@gmail.com, Sep 11, 2009
*NOTE: Do not post confidential information in this bug report.*

What version are you running?
ReviewBoard 1.0.1

What's the URL of the page containing the problem?
[ sorry, not accessible, it's behind the company firewall ]

What steps will reproduce the problem?
1. Publish review, add 2 reviewers
2. Edit reviewers -- remove first, but leave a space char before second
3. Click OK
>> Result: everything appears to be fine, page rendered correctly; however,
hitting the refresh on the browser produces TemplateSyntaxError


What is the expected output? What do you see instead?

The Dashboard for this review ID should render correctly.

However, accessing the review ID (i.e. http://company.com/r/123/) will
always produces the following exception:
| TemplateSyntaxError at /r/123/
| Caught an exception while rendering: Reverse for 'reviewboard.user' with
arguments '(<User:  zoran.rajic>,)' and keyword arguments '{}' not found.


.. furthermore, a brand new username seems to be inserted into the
reviewboard's database (note the ' '-char in front of the e-mail:

mysql> select * from auth_user where id=67 \G;
*************************** 1. row ***************************
          id: 67
    username:  zoran.rajic
  first_name: Zoran
   last_name: Rajic
       email:  zoran.rajic@company.com
    password: !
    is_staff: 0
   is_active: 1
is_superuser: 0
  last_login: 2009-09-11 13:52:21
 date_joined: 2009-09-11 13:52:21
1 row in set (0.01 sec)

The new username is also reflected in the list of users - so one ends up
with "username" and " username" in the list.


What operating system are you using? What browser?

ReviewBoard 1.0.1 running on OpenSuse v11.1 64bit Linux, Python v2.6.0,
Apache v2.2.10, MySQL v5.0.67

Reproduced with Firefox 3.5 (Windows and Linux), also MS Internet Exploder 7


Please provide any additional information below.

Exception stack-trace:

Exception Type: TemplateSyntaxError 
Exception Value: Caught an exception while rendering: Reverse for
'reviewboard.user' with arguments '(<User:  zoran.rajic>,)' and keyword
arguments '{}' not found. 

Template error
In template
/usr/local/lib64/python2.6/site-packages/ReviewBoard-1.0.1-py2.6.egg/reviewboard/templates/reviews/review_request_box.html,
error at line 49

Caught an exception while rendering: Reverse for 'reviewboard.user' with
arguments '(<User: zoran.rajic>,)' and keyword arguments '{}' not found.
39    <td class="label"><label for="bugs_closed">{% trans "Bugs"
%}:</label></td>
40    <td class="value"><span id="bugs_closed" class="editable
comma-editable">{% spaceless %}
41 {%  for bug in review_request_details.get_bug_list %}
42 {%   with bug|bug_url:review_request as bug_url %}
43 {%    if bug_url %}<a href="{{bug_url}}">{{bug}}</a>{% else %}{{bug}}{%
endif %}{% if not forloop.last %}, {% endif %}
44 {%   endwith %}
45 {%  endfor %}
46 {% endspaceless %}</span></td>
47    <td class="indented label"><label for="target_people">{% trans
"People" %}:</label></td>
48    <td class="value"><span id="target_people" class="editable
comma-editable">{% spaceless %}
49 {%  for person in review_request_details.target_people.all %}
50 <a href="{% url user person %}"{% if not person.is_active %}
class="inactive"{% endif %}>{{person}}</a>{% if not forloop.last %}, {%
endif %}
51 {%  endfor %}
52 {% endspaceless %}</span></td>
53   </tr>
54   <tr>
55    <td class="label"><label for="changenum">{% trans "Change Number"
%}:</label></td>
56    <td class="value"><span
id="changenum">{{review_request.changenum}}</span></td>
57    <td class="label"><label for="repository">{% trans "Repository"
%}:</label></td>
58    <td class="value"><span
id="repository">{{review_request.repository}}</span></td>
59   </tr>
reproducing_defect.png
7.2 KB   View   Download
Comment 1 by project member chip...@gmail.com, Sep 14, 2009
(No comment was entered for this change.)
Status: Confirmed
Labels: Milestone-Release1.0.x Component-Reviews
Comment 2 by project member chip...@gmail.com, Sep 15, 2009
What authentication mechanism are you using?

The core issue is that we're attempting to look up the user and we find it in the
backend, but we're not finding a User object that matches, so we create one, with the
space in the filename.
Status: NeedInfo
Labels: -Component-Reviews Component-Accounts
Comment 3 by zoran.ra...@gmail.com, Sep 21, 2009
Hello chipx86,

I'm using the LDAP server for the authentication.  If I may suggest, it's generally 
highly irregular to have the usernames prefixed with ' ' (space) characters, on 
pretty much anything (UX/Win accounts, DBs, Wikis...) so perhaps we could trim the 
leading whitespaces on the input?

BTW (perhaps people can use this as a workaround): if one removes the offending 
usernames from the ReviewBoard, the TemplateSyntaxError goes away and review ID's 
dashboard renders OK again.
What one needs to do, is use use http://company.com/admin/db/auth/user/ as admin, 
sort by Username, and remove users that pop up on the top, which seem to be outside 
of the alphabetical order (note that the space-char leading usernames will be on the 
top, but it's not very obvious with the HTML rendering, so they'll appear as outside 
of "sorting order").

Thanks,
	Zoran
Comment 4 by project member chip...@gmail.com, Sep 22, 2009
Fixed in r81c2ae9.
Status: Fixed
Owner: chipx86
Sign in to add a comment

Powered by Google Project Hosting