[Zope] Critical Question for Dieter - Spoke to soon
   
    Michael
     
    mlewis@exasource.com
       
    Wed, 15 May 2002 08:00:50 -0600
    
    
  
Bakhtiar,
When I tried this initially, (I've been up for about 36 hours), I used:
<dtml-in Catalog>
<dtml-if "Catalog(username={'query'_['username']})">
<dtml-call "RESPONSE.redirect('duplicate_record')">
</dtml-if>
</dtml-in>
<dtml-call "REQUEST.set('username',username)">
<dtml-with "manage_addProduct['CandidateInfo']">
<dtml-call "candidate_info_entry_add(_.None, _, NoRedir=1)">
</dtml-with>
When I tried to enter a duplicate it redirected me and when I entered a 
unique address, it entered it.  Then I noticed that even though I was 
redirected, it still entered the information because of the way I 
structured the test.  When I re-did it as follows:
<dtml-in Catalog>
<dtml-if "Catalog(username={'query'_['username']})">
<dtml-call "RESPONSE.redirect('duplicate_record')">
<dtml-else>
<dtml-call "REQUEST.set('username',username)">
<dtml-with "manage_addProduct['CandidateInfo']">
<dtml-call "candidate_info_entry_add(_.None, _, NoRedir=1)">
</dtml-with>
</dtml-if>
</dtml-in>
It will still redirect me, but when I enter a unique address, it does 
not enter the record, but gives the message that it has.  Sorry about that.
Michael