diff --git a/classes/webservice.php b/classes/webservice.php index 901e4686..783ad69e 100644 --- a/classes/webservice.php +++ b/classes/webservice.php @@ -812,15 +812,15 @@ public function provide_license($zoomuserid) { // Changes least_recently_active_user to a basic user so we can use their license. if ($leastrecentlyactivepaiduserid) { $this->make_call("users/$leastrecentlyactivepaiduserid", ['type' => ZOOM_USER_TYPE_BASIC], 'patch'); - } else { - throw new moodle_exception('errornousersfound', 'mod_zoom'); } } // Changes current user to pro so they can make a meeting. // Classic: user:write:admin. // Granular: user:update:user:admin. - $this->make_call("users/$zoomuserid", ['type' => ZOOM_USER_TYPE_PRO], 'patch'); + if (!$this->paid_user_limit_reached() || $leastrecentlyactivepaiduserid) { + $this->make_call("users/$zoomuserid", ['type' => ZOOM_USER_TYPE_PRO], 'patch'); + } } } diff --git a/lang/en/zoom.php b/lang/en/zoom.php index 470e773c..26d7de83 100644 --- a/lang/en/zoom.php +++ b/lang/en/zoom.php @@ -131,7 +131,6 @@ $string['err_start_time_past_recurring'] = 'For recurring meetings, the date portion of this field is the earliest possible date for the next meeting. This date must be today or in the future.'; $string['err_weekly_days'] = 'Select day(s) for the recurring weekly meeting'; $string['erroraddinstance'] = 'Could not create new zoom meeting. Invalid options selected for a recurring meeting.'; -$string['errornousersfound'] = 'There is no user to borrow license from.'; $string['errorwebservice'] = 'Zoom webservice error: {$a}.'; $string['errorwebservice_badrequest'] = 'Zoom received a bad request: {$a}'; $string['errorwebservice_notfound'] = 'The resource does not exists';