1st issue:
When an exception was raised, it was badly handled by the website in case of
website_enabled key. The response page was generated without calling super.
The WebRequest object being responsible to rollback the transaction in case
of errors.
2sd issue:
The _failed attribute is required to rollback the transaction in an WebRequest
object. Previously it was only set in the JsonRequest object (which inherit
from WebRequest), replace by call to super. The attribute _failed is now set
in the WebRequest object.
Typically an exception during a JSON-RPC request must be
handled specifically and return a JSON-RPC error in all
cases. Previously the _authenticate() step could fail
during ir_http.dispatch() and bubble up to werkzeug,
yielding a dumb "Internal Server Error 500" even for
a JSON-RPC request.
bzr revid: odo@openerp.com-20140328142748-00haplmkc3fv6f9y
Not doing so leads to cases where a transaction is committed
even after failing to validate a Python constraint.
This patch attempts to keep the rollback() logic next to the
corresponding commit(), and makes the rollback() more
explicit even if close() without commit() would also rollback
implicitly.
bzr revid: odo@openerp.com-20140317163228-zqbce8f0rgcg0pt4
The route function can be call more than once in case of database error,
breaking the request cursor. By rollbacking it, we force the creation of a new transaction.
bzr revid: chs@openerp.com-20140311095550-lg3nvvjyojvgp2po
[MOV] ensure_db() helper from http module to web module
Since we removed auth="admin" in favor of auth="none" with explicit superuser id usage,
the disable_db clause in auth_none() has only sense for the /web and /web/login routes.
The web module is an exception because it's routes are registered for the nodb dispatching.
This is why the ensure_db() helper is moved to web client and will take care of the
web's auth="none" routes that needs a db to work with
bzr revid: fme@openerp.com-20140130092152-h6elwf2yerhd9xey
A helper that allows to force a db in the controller context otherwise redirect to database selector
Used for /web, /web/login and auth_* modules
bzr revid: fme@openerp.com-20140128211550-vmhy5nu0qbi33qh5
During some tests, the runner performs sequences of DUPLICATE and DROP
on databases. Each DUPLICATE is followed by some operations then a
DROP.
Problem is, after a DROP the next DUPLICATE RPC query will attempt a
connection to the just-dropped database, openerp.sql_db will log an
OperationalError ("Connection to the database failed" since the db it
tries to connect to was removed) then the HTTP dispatcher will just
switch to "nodb" and continue on its merry way.
Mute the sql_db logger while attempting to fetch the ir.http object.
Also assert that the logger name is a string in mute_logger, as
`mute_logger(openerp.sql_db)` is syntactically valid, but will not do
anything.
bzr revid: xmo@openerp.com-20140123115413-ax5patcomdfp3ue3
main problem, view inheritance model field would use model from the
root view (after following inherit_id links) rather than the base view
(the requested one) -> with divergent models, it was possible for the
requested view itself to never be returned.
bzr revid: xmo@openerp.com-20131212134422-uxg6h21w1jhth9ow
* make ModelConverter use its regex for data extraction so
replacements can just fixup the request and don't have to mess with
_uid
* replace routing_map property by method, for unknown reasons the
property does not work at least overridden (it's not found) and I
don't care enough to wonder why
* arguments result from MapAdapter.match() is a mapping, not a
sequence. Iterate through values()/itervalues() otherwise we'll
never get a browse_record to do the uid substitution on, only
strings (params names)
* inject arguments from URL map/match into the function before
executing it, this was apparently lost during the transition
* reintroduce get_db_router for third-party code needing to generate
URLs
bzr revid: xmo@openerp.com-20131115124819-bp4gjpfdlda2qyf5
* fix nameerror on SessionExpired exception not being imported
* remove pointless RequestUID instantiation by single placeholder object
- may be replaceable with a LocalProxy or something along those lines?
* rename default/nodb routing map
* make better use of werkzeug API
* move lazy routing_map instantiation to property in ir_http.find_handler
- do we have some sort of lazy_property?
bzr revid: xmo@openerp.com-20131115100901-s3skmwv9d1jgk9y0