[LON-CAPA-cvs] cvs: loncom /interface londropadd.pm

matthew lon-capa-cvs@mail.lon-capa.org
Fri, 03 May 2002 17:45:07 -0000


matthew		Fri May  3 13:45:07 2002 EDT

  Modified files:              
    /loncom/interface	londropadd.pm 
  Log:
  Fixes BUG 330.  If the enrollment database file does not exist we take this
  to mean the course does not have any students enrolled.
  
  
Index: loncom/interface/londropadd.pm
diff -u loncom/interface/londropadd.pm:1.38 loncom/interface/londropadd.pm:1.39
--- loncom/interface/londropadd.pm:1.38	Fri May  3 12:30:48 2002
+++ loncom/interface/londropadd.pm	Fri May  3 13:45:07 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to drop and add students in courses 
 #
-# $Id: londropadd.pm,v 1.38 2002/05/03 16:30:48 matthew Exp $
+# $Id: londropadd.pm,v 1.39 2002/05/03 17:45:07 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -699,7 +699,11 @@
     my ($error,%currentlist)=&get_current_classlist
         ($ENV{'course.'.$cid.'.domain'},$ENV{'course.'.$cid.'.num'});
     if (defined($error)) {
-        $r->print("<pre>ERROR:$error</pre>");
+        if ($error =~ /^No such file or directory/) {
+            $r->print("There are no students currently enrolled.\n");
+        } else {
+            $r->print("<pre>ERROR:$error</pre>");
+        }
     } elsif (!defined(%currentlist)) { 
         $r->print("There are no students currently enrolled.\n");
     } else {