Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
abort transaction if something fails
Browse files Browse the repository at this point in the history
  • Loading branch information
zupo committed Dec 28, 2012
1 parent b734a18 commit 76346c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Changelog
1.1 (Unreleased)
----------------

- Abort transaction if something fails.
[zupo]

- Use 'ipn_' as a prefix for product group IDs.
[zupo]

Expand Down
4 changes: 4 additions & 0 deletions src/niteoweb/ipn/jvzoo/jvzoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from Products.CMFCore.interfaces import ISiteRoot
from zope.component import getAdapter

import transaction
import hashlib
import logging

Expand Down Expand Up @@ -72,16 +73,19 @@ def render(self):
except KeyError as ex:
msg = "POST parameter missing: %s" % ex
logger.warning(msg)
transaction.abort()
return msg

except AssertionError:
msg = "Checksum verification failed."
logger.warning(msg)
transaction.abort()
return msg

except Exception as ex:
msg = "POST handling failed: %s" % ex
logger.warning(msg)
transaction.abort()
return msg

return 'Done.'
Expand Down

0 comments on commit 76346c6

Please sign in to comment.