equal
deleted
inserted
replaced
43 |
43 |
44 req = request.cw_request |
44 req = request.cw_request |
45 vreg = request.registry['cubicweb.registry'] |
45 vreg = request.registry['cubicweb.registry'] |
46 |
46 |
47 try: |
47 try: |
|
48 content = None |
48 try: |
49 try: |
49 with cw_to_pyramid(request): |
50 with cw_to_pyramid(request): |
50 cors.process_request(req, vreg.config) |
|
51 ctrlid, rset = self.appli.url_resolver.process(req, req.path) |
51 ctrlid, rset = self.appli.url_resolver.process(req, req.path) |
52 |
52 |
53 try: |
53 try: |
54 controller = vreg['controllers'].select( |
54 controller = vreg['controllers'].select( |
55 ctrlid, req, appli=self.appli) |
55 ctrlid, req, appli=self.appli) |
67 if req.cnx: |
67 if req.cnx: |
68 txuuid = req.cnx.commit() |
68 txuuid = req.cnx.commit() |
69 # commited = True |
69 # commited = True |
70 if txuuid is not None: |
70 if txuuid is not None: |
71 req.data['last_undoable_transaction'] = txuuid |
71 req.data['last_undoable_transaction'] = txuuid |
72 except cors.CORSPreflight: |
|
73 request.response.status_int = 200 |
|
74 except cubicweb.web.ValidationError as ex: |
72 except cubicweb.web.ValidationError as ex: |
75 # XXX The validation_error_handler implementation is light, we |
73 # XXX The validation_error_handler implementation is light, we |
76 # should redo it better in cw_to_pyramid, so it can be properly |
74 # should redo it better in cw_to_pyramid, so it can be properly |
77 # handled when raised from a cubicweb view. |
75 # handled when raised from a cubicweb view. |
78 # BUT the real handling of validation errors should be done |
76 # BUT the real handling of validation errors should be done |