Unnecessary calls to new User object in can_view_view

Bug #1523298 reported by Robert Lyon on 2015-12-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Medium
Robert Lyon
15.10
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

Robert Lyon (robertl-9) on 2015-12-07
Changed in mahara:
status: New → In Progress
summary: - unnecessary calls to new User object
+ Unnecessary calls to new User object in can_view_view
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

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>

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  Edit
Everyone can see this information.

Other bug subscribers