| 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 |
|
| 3 |
def migrate(cr, version): |
| 4 |
# Remove the csrf_token and its surrounding div from the |
| 5 |
# website_hr_recruitment.apply (it was set with a t-att- breaking the |
| 6 |
# possibility to properly edit the form, and it was actually useless). |
| 7 |
cr.execute(r""" |
| 8 |
UPDATE ir_ui_view |
| 9 |
SET arch_db = REGEXP_REPLACE(arch_db::text, '<div[^<]*>[^<]*<input[^>]+id=\\"csrf_token\\"[^>]*/>[^<]*</div>', '', 'g')::jsonb |
| 10 |
WHERE key = 'website_hr_recruitment.apply' |
| 11 |
AND website_id IS NOT NULL |
| 12 |
AND arch_db::text LIKE '%csrf_token%' |
| 13 |
""") |