Index: openacs-4/packages/dotlrn-ecommerce/www/ecommerce/shopping-cart-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/ecommerce/shopping-cart-add.tcl,v diff -u -N -r1.29 -r1.30 --- openacs-4/packages/dotlrn-ecommerce/www/ecommerce/shopping-cart-add.tcl 1 Oct 2005 21:44:39 -0000 1.29 +++ openacs-4/packages/dotlrn-ecommerce/www/ecommerce/shopping-cart-add.tcl 4 Oct 2005 19:05:38 -0000 1.30 @@ -98,6 +98,22 @@ where product_id = :product_id } +# See if this user already has a pending application or is already +# registered to the course +if { [db_0or1row existing_rel { + select rel_id + from dotlrn_member_rels_full + where user_id = :participant_id + and community_id = :community_id +}] } { + if { [exists_and_not_null return_url] } { + ad_returnredirect $return_url + } else { + ad_returnredirect [ad_conn package_url] + } + ad_script_abort +} + if { [acs_object_type $participant_id] != "group" } { ns_log notice "DEBUG:: checking if this should go to the waiting list"