diff --git a/course/togglecompletion.php b/course/togglecompletion.php
index 9dc19db..095b427 100644
--- a/course/togglecompletion.php
+++ b/course/togglecompletion.php
@@ -47,8 +47,6 @@ if ($courseid) {
     $completion = new completion_info($course);
     if (!$completion->is_enabled()) {
         throw new moodle_exception('completionnotenabled', 'completion');
-    } elseif (!$completion->is_tracked_user($USER->id)) {
-        throw new moodle_exception('nottracked', 'completion');
     }
 
     // Check if we are marking a user complete via the completion report
@@ -80,6 +78,9 @@ if ($courseid) {
         }
 
     } else {
+        if (!$completion->is_tracked_user($USER->id)) {
+            throw new moodle_exception('nottracked', 'completion');
+        }
 
         // Confirm with user
         if ($confirm and confirm_sesskey()) {
