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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 03 Feb 2006 18:51:16 -0000


albertel		Fri Feb  3 13:51:16 2006 EDT

  Modified files:              
    /loncom/interface	slotrequest.pm 
  Log:
  - some more error checks
  
  
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.40 loncom/interface/slotrequest.pm:1.41
--- loncom/interface/slotrequest.pm:1.40	Fri Feb  3 13:22:44 2006
+++ loncom/interface/slotrequest.pm	Fri Feb  3 13:51:15 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.40 2006/02/03 18:22:44 albertel Exp $
+# $Id: slotrequest.pm,v 1.41 2006/02/03 18:51:15 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -126,6 +126,10 @@
     my ($cnum,$cdom)=&get_course();
     my %slots=&Apache::lonnet::get('slots', [@slots], $cdom, $cnum);
 
+    if (&network_error($student) || &network_error($course)  ||
+	&network_error(%slots)) {
+	return 'error: Unable to determine current status';
+    }    
     foreach my $slot_name (@slots) {
 	next if (!defined($slots{$slot_name}) ||
 		 !ref($slots{$slot_name}));
@@ -150,9 +154,9 @@
     my @slots = (split(/:/,$student), split(/:/, $course));
     my ($cnum,$cdom)=&get_course();
     my %slots=&Apache::lonnet::get('slots', [@slots], $cdom, $cnum);
-    my ($tmp) = %slots;
+
     if (&network_error($student) || &network_error($course)  ||
-	&network_error($tmp)) {
+	&network_error(%slots)) {
 	return 'error: Unable to determine current status';
     }    
     foreach my $slot_name (@slots) {