Index: openacs-4/packages/news-aggregator/tcl/subscription-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-aggregator/tcl/subscription-procs.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/news-aggregator/tcl/subscription-procs.tcl 18 Jul 2018 16:13:06 -0000 1.4 +++ openacs-4/packages/news-aggregator/tcl/subscription-procs.tcl 1 Sep 2020 17:49:05 -0000 1.5 @@ -16,22 +16,18 @@ Creates a new subscription to a source in an aggregator. If one already exists this proc would just skipt the new creation. } { - if {![db_string subscription_exists_p { - select exists (select 1 from na_subscriptions - where aggregator_id = :aggregator_id - and source_id = :source_id) - }]} { - db_dml insert_subscription { - insert into na_subscriptions ( - aggregator_id, - source_id, - creation_date - ) values ( - :aggregator_id, - :source_id, - current_timestamp - ) - } + db_dml insert_subscription { + insert into na_subscriptions ( + aggregator_id, + source_id, + creation_date + ) select :aggregator_id, + :source_id, + current_timestamp + from dual + where not exists (select 1 from na_subscriptions + where aggregator_id = :aggregator_id + and source_id = :source_id) } }