prevent more duplicate MACs from sneaking in in the interim
authorjeff <jeff>
Fri, 13 Mar 2009 18:22:21 +0000 (18:22 +0000)
committerjeff <jeff>
Fri, 13 Mar 2009 18:22:21 +0000 (18:22 +0000)
FS/FS/svc_broadband.pm

index b808527..eb29646 100755 (executable)
@@ -217,6 +217,10 @@ sub check {
   ;
   return $error if $error;
 
+  #redundant, but prevents further problems until column constraint in place
+  return "MAC already in use"
+    if scalar( qsearch( 'svc_broadband', { 'mac_addr', $self->mac_addr } ) );
+
   if($self->speed_up < 0) { return 'speed_up must be positive'; }
   if($self->speed_down < 0) { return 'speed_down must be positive'; }