Unnecessary calls to new User object in can_view_view

Bug #1523298 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Robert Lyon
15.10
Fix Released
Medium
Unassigned

Bug Description

Slimming down the number of calls to new User/find_by_id() when we already have the User object being passed around

Tags: performance
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5820

Robert Lyon (robertl-9)
Changed in mahara:
status: New → In Progress
summary: - unnecessary calls to new User object
+ Unnecessary calls to new User object in can_view_view
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Since this change is small and completely backwards-compatible, we may as well backport it to the current stable release as well.

Changed in mahara:
importance: Undecided → Medium
assignee: nobody → Robert Lyon (robertl-9)
tags: added: performance
Changed in mahara:
milestone: none → 16.04.0
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5820
Committed: https://git.mahara.org/mahara/mahara/commit/2bcebcd4bb1359f924a438742bafad0486e6dc5f
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 2bcebcd4bb1359f924a438742bafad0486e6dc5f
Author: Robert Lyon <email address hidden>
Date: Mon Dec 7 13:32:10 2015 +1300

Bug 1523298: Make get_owner_object() return LiveUser object

This way we can avoid re-making it multiple times further down the
chain.

Most places where the get_owner_object() object was passed can handle
dealing with a User object vs a StdObject anyway.

behatnotneeded - existing tests should suffice

Change-Id: I2b92d9e408066a9c3b4c2f0bb87fbe8370bf9911
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "15.10_STABLE" branch: https://reviews.mahara.org/6016

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/6016
Committed: https://git.mahara.org/mahara/mahara/commit/dfbdc06714f1b0e89deefee8deb2f38735463d07
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.10_STABLE

commit dfbdc06714f1b0e89deefee8deb2f38735463d07
Author: Robert Lyon <email address hidden>
Date: Mon Dec 7 13:32:10 2015 +1300

Bug 1523298: Make get_owner_object() return LiveUser object

This way we can avoid re-making it multiple times further down the
chain.

Most places where the get_owner_object() object was passed can handle
dealing with a User object vs a StdObject anyway.

behatnotneeded - existing tests should suffice

Change-Id: I2b92d9e408066a9c3b4c2f0bb87fbe8370bf9911
Signed-off-by: Robert Lyon <email address hidden>
(cherry picked from commit 2bcebcd4bb1359f924a438742bafad0486e6dc5f)

no longer affects: mahara/16.04
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.