fix silly bug editing agents
authorivan <ivan>
Thu, 1 Jul 2004 12:45:04 +0000 (12:45 +0000)
committerivan <ivan>
Thu, 1 Jul 2004 12:45:04 +0000 (12:45 +0000)
FS/FS/agent.pm

index 7c69dfb..a9e41a6 100644 (file)
@@ -127,7 +127,7 @@ sub check {
     if ( length($self->username) ) {
       my $conflict = qsearchs('agent', { 'username' => $self->username } );
       return 'duplicate agent username (with '. $conflict->agent. ')'
     if ( length($self->username) ) {
       my $conflict = qsearchs('agent', { 'username' => $self->username } );
       return 'duplicate agent username (with '. $conflict->agent. ')'
-        if $conflict;
+        if $conflict && $conflict->agentnum != $self->agentnum;
       $error = $self->ut_text('password'); # ut_text... arbitrary choice
     } else {
       $self->_password('');
       $error = $self->ut_text('password'); # ut_text... arbitrary choice
     } else {
       $self->_password('');