14919: make indentation and coding match expectations
authorMike Robinson <miker@freeside.biz>
Mon, 30 Apr 2012 20:09:19 +0000 (15:09 -0500)
committerMike Robinson <miker@freeside.biz>
Mon, 30 Apr 2012 20:09:19 +0000 (15:09 -0500)
FS/FS/option_Common.pm
FS/FS/part_export/netsapiens.pm

index 40b12cf..c1dda22 100644 (file)
@@ -67,13 +67,8 @@ sub insert {
 
   my $error;
   
-  $error = $self->check_options($options);
-  if ( $error ) {
-    $dbh->rollback if $oldAutoCommit;
-    return $error;
-  }
-  
-  $error = $self->SUPER::insert;
+  $error = $self->check_options($options) 
+           || $self->SUPER::insert;
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;
     return $error;
index b30951d..aa89d47 100644 (file)
@@ -83,16 +83,16 @@ sub rebless { shift; }
 
 
 sub check_options {
-       my ($self, $options) = @_;
+  my ($self, $options) = @_;
        
-       my $rex = qr/$RE{URI}{HTTP}{-scheme => qr|https?|}/;                    # match any "http:" or "https:" URL
+  my $rex = qr/$RE{URI}{HTTP}{-scheme => qr|https?|}/;                 # match any "http:" or "https:" URL
        
-       for my $key (qw/url device_url/) {
-               if ($$options{$key} && ($$options{$key} !~ $rex)) {
-                               return "Invalid (URL): " . $$options{$key};
-               }
-       }
-       return '';
+  for my $key (qw/url device_url/) {
+    if ($$options{$key} && ($$options{$key} !~ $rex)) {
+      return "Invalid (URL): " . $$options{$key};
+    }
+  }
+  return '';
 }