Hello
TG 1.01
SO 0.8x
FIREBIRD 2.0 64
I have following code in my controller:
@expose(template="dms2.templates.newaccount")
@identity.require(identity.in_group("BUSER"))
def newaccount(self,tg_errors=None):
return dict(form=accountaddform)
@expose()
@error_handler(newaccount)
@identity.require(identity.in_group("BUSER"))
@validate(form=accountaddform)
def uploadacc(self,alias,beneficiary,account,bank,tg_errors=None):
if tg_errors==None:
result=Bdata(alias=alias,beneficiary=beneficiary,account=account,bank=bank)
flash("New Beneficiary Account Record added ok")
raise redirect('/bene')
else:
flash("ATTENTION --> Record was not inserted ! Beneficiary
exists
")
raise redirect('/bene')
The problem is that if the record is inserted ok and tg-errors=None
then
everything is fine. If the record is not added (e.g. because it
already exists)
I get an error dump rather than the expected redirect with flash
message.
last lines of the dump:
File "/usr/local/lib64/python2.4/site-packages/SQLObject-0.8.1-
py2.4.egg/sqlobject/firebird/firebirdconnection.py", line 105, in
_queryInsertID
c.execute(q)
ProgrammingError: (-803, 'isc_dsql_execute: \n attempt to store
duplicate value (visible to active transactions) in unique index
"BDATA_IDX1"')
What am I doing wrong ?
Thanks
Db
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---