[freeside-commits] branch master updated. 88269174c839d6953f30e2f849bc60327dd10f07

Mark Wells mark at 420.am
Thu Apr 26 13:27:23 PDT 2012


The branch, master has been updated
       via  88269174c839d6953f30e2f849bc60327dd10f07 (commit)
      from  3775fafeb19d7dab5f7104e03685ec8dc0d3a8f7 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 88269174c839d6953f30e2f849bc60327dd10f07
Author: Mark Wells <mark at freeside.biz>
Date:   Thu Apr 26 13:25:50 2012 -0700

    better duplicate checking for ip address, #17515

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 3894f65..d42b946 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -2556,7 +2556,7 @@ sub tables_hashref {
         'plan_id',             'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'svcnum',
-      'unique'      => [ [ 'mac_addr' ] ],
+      'unique'      => [ [ 'ip_addr' ], [ 'mac_addr' ] ],
       'index'       => [],
     },
 
diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 64cc377..8210269 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -543,9 +543,9 @@ sub _check_ip_addr {
 
 sub _check_duplicate {
   my $self = shift;
-
-  $self->lock_table;
-
+  # Not a reliable check because the table isn't locked, but 
+  # that's why we have a unique index.  This is just to give a
+  # friendlier error message.
   my @dup;
   @dup = $self->find_duplicates('global', 'ip_addr');
   if ( @dup ) {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Schema.pm        |    2 +-
 FS/FS/svc_broadband.pm |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list