return event if relevent queue name exists
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 19 Sep 2008 20:51:39 +0000 (20:51 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 19 Sep 2008 20:51:39 +0000 (20:51 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10650 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Vandelay.pm

index 2883f62..d11fd21 100644 (file)
@@ -41,6 +41,10 @@ sub create_bib_queue {
        return $e->die_event unless $e->allowed('CREATE_BIB_IMPORT_QUEUE');
     $owner ||= $e->requestor->id;
 
+    return OpenILS::Event->new('BIB_QUEUE_EXISTS') 
+        if $e->search_vandelay_bib_queue(
+            {name => $name, owner => $owner, queue_type => $type})->[0];
+
        my $queue = new Fieldmapper::vandelay::bib_queue();
        $queue->name( $name );
        $queue->owner( $owner );
@@ -74,6 +78,10 @@ sub create_auth_queue {
        return $e->die_event unless $e->allowed('CREATE_AUTHORITY_IMPORT_QUEUE');
     $owner ||= $e->requestor->id;
 
+    return OpenILS::Event->new('AUTH_QUEUE_EXISTS') 
+        if $e->search_vandelay_bib_queue(
+            {name => $name, owner => $owner, queue_type => $type})->[0];
+
        my $queue = new Fieldmapper::vandelay::authority_queue();
        $queue->name( $name );
        $queue->owner( $owner );