Permalink
Browse files

MDL-29695 enrol-cohort: Minor code improvement

  • Loading branch information...
1 parent 543009c commit e797476fd2f92a3b9a9b9a6a98a2eba68ae351a4 Sam Hemelryk committed Oct 17, 2011
Showing with 1 addition and 2 deletions.
  1. +1 −2 enrol/cohort/locallib.php
@@ -289,8 +289,7 @@ function enrol_cohort_get_cohorts(course_enrolment_manager $manager) {
*/
function enrol_cohort_can_view_cohort($cohortid) {
global $DB;
- $cohort = $DB->get_record_select('cohort', 'id = ?', array($cohortid));
-
+ $cohort = $DB->get_record('cohort', array('id' => $cohortid), 'id, contextid');
if ($cohort) {
$context = get_context_instance_by_id($cohort->contextid);
if (has_capability('moodle/cohort:view', $context)) {

0 comments on commit e797476

Please sign in to comment.