Skip to content

Commit

Permalink
updates for recent mojo
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Duggan committed Jul 24, 2015
1 parent 3a1dbe1 commit 9feb364
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/Tuba/Controller.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1287,11 +1287,11 @@ sub remove {
my @replacement;
if ($json && $json->{replacement}) {
my $rpl = $c->uri_to_obj($json->{replacement})
or return $c->render_exception("couldn't find $json->{replacement}");
or return $c->render->exception("couldn't find $json->{replacement}");
@replacement = (replacement => $rpl);
}
$object->delete(audit_user => $c->user, @replacement)
or return $c->render_exception($object->error);
or return $c->reply->exception($object->error);
return $c->render(text => 'ok');
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Tuba/Exterm.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sub remove {
term => $c->stash('term'),
);
$term->load(speculative => 1) or return $c->reply->not_found;
$term->delete(audit_user => $c->user, audit_note => $c->audit_note) or return $c->render_exception($term->error);
$term->delete(audit_user => $c->user, audit_note => $c->audit_note) or return $c->reply->exception($term->error);
return $c->render(text => 'ok');
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Tuba/Reference.pm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ sub update_rel {
return $c->render(status => 400, json => { error => "$pub_uri not found" });
};
$reference->add_publications({id => $pub->id});
$reference->save(changes_only => 1, audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->render_exception;
$reference->save(changes_only => 1, audit_user => $c->audit_user, audit_note => $c->audit_note) or return $c->reply->exception;
}
if (my $subpubref = $json->{delete_subpub}) { # Deprecation
return $c->render(status => 400, json => { error => "delete_subpub is deprecated, use delete_publication"} );
Expand All @@ -258,7 +258,7 @@ sub update_rel {
};
my $sub = PublicationReferenceMap->new(reference_identifier => $reference->identifier, publication_id => $pub->id);
$sub->load(speculative => 1) or return $c->redirect_with_error(update_rel_form => "$pub not found");
$sub->delete or return $c->render_exception;
$sub->delete or return $c->reply->exception($sub->error);
}

return $c->render(json => { status => 'ok'});
Expand Down

0 comments on commit 9feb364

Please sign in to comment.