Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3445 by ReviewRequest.get_last_activity() always returns the ReviewRequest itself

*** You must complete this form in its entirety, or your bug report will be
*** rejected.
*** If you have a security issue to report, please send it confidentially
*** Posting security-related issues to this bug
*** tracker causes us to have to do an emergency release.
*** For customer support, please post to
*** If you have a patch, please submit it to
*** This bug tracker is public. Please check that any logs or other
*** that you include has been stripped of confidential information.

What version are you running?

Review Board 2.1 alpha 0 (dev)

What's the URL of the page containing the problem?

My local page.

What steps will reproduce the problem?
1. Add a review to a review request
2. Compare timestamps between the latest review and the last_updated field on the review request

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

ReviewRequest.get_last_activity() always returns the ReviewRequest itself instead of any of the reviews. This is because the last_updated field on a ReviewRequest gets set to a time after the latest review, so there is never a review that is newer than the ReviewRequest itself.

What operating system are you using? What browser?

Ubuntu and Chrome

Please provide any additional information below.

I'm trying to write an extension that will display the last user to update a review request. However, ReviewRequest.get_last_activity() keeps returning the ReviewRequest itself, so it always displays the submitter's name.

I made an update as a different user than the one I submitted with and got this:

$ python reviewboard/ shell
from import ReviewRequest as RR
[<ReviewRequest: Test1>]
rr = RR.objects.all()[0]
r =
<Review: Review of 'Test1'>
datetime.datetime(2014, 6, 26, 19, 46, 45, 65830, tzinfo=<UTC>)
datetime.datetime(2014, 6, 26, 19, 46, 45, 153334, tzinfo=<UTC>)

Here is the code I was playing with:

class LastUpdatedByColumn(Column):
    def render_data(self, stateful_column, review_request):
        timestamp, updated_object = review_request.get_last_activity()
        if hasattr(updated_object, 'user'):
           return updated_object.user.username
        elif hasattr(updated_object, 'submitter'):
           return updated_object.submitter.username
        return '??? %s' % updated_object.__class__.__name__

class LastUpdatedBy(Extension):
    metadata = {
        'Name': 'LastUpdatedBy',
'Summary': 'A column that displays who the last user was to update a review request.',

    def initialize(self):
        DashboardColumnsHook(self, [
                                label='Last Updated',
                                detailed_label='Last Updated By'),

You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:

You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to