Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 5319:62de601bdf6f
Fix commits although a Reject exception is raised
Fix the problem that changes are committed to the database (due to
commits to otk handling) even when a Reject exception occurs. The fix
implements separate database connections for otk/session handling and
normal database operation.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Fri, 20 Apr 2018 18:46:28 +0200 |
| parents | 32f95ec6bd8e |
| children | 7c7f3faa5e10 |
comparison
equal
deleted
inserted
replaced
| 5318:506c7ee9a385 | 5319:62de601bdf6f |
|---|---|
| 102 # to current time (time.time()). | 102 # to current time (time.time()). |
| 103 ts = time.time() + ((lifetime - 10080) * 60) | 103 ts = time.time() + ((lifetime - 10080) * 60) |
| 104 otks.set(key, uid=client.db.getuid(), | 104 otks.set(key, uid=client.db.getuid(), |
| 105 sid=client.session_api._sid, | 105 sid=client.session_api._sid, |
| 106 __timestamp=ts ) | 106 __timestamp=ts ) |
| 107 client.db.commit() | 107 otks.commit() |
| 108 return key | 108 return key |
| 109 | 109 |
| 110 ### templating | 110 ### templating |
| 111 | 111 |
| 112 class NoTemplate(BaseException): | 112 class NoTemplate(BaseException): |
