From 1e4b7c42fa258cdb74c992f8c2829fb6f85d7640 Mon Sep 17 00:00:00 2001 From: David Monjoie Date: Thu, 30 Apr 2015 09:38:19 +0200 Subject: [PATCH] [REV] website_hr_recruitment: revert ee91d1e This commit would makes us very vulnerable to spams and malevolent bots who would forge e-mails to force the creation of a res_partner for each e-mail, quickly overloading the database. I'm reverting this as it was requested by al. After discussion with yti, the original issue was that to use the mail thread on the hr application, the user needed to create a res_partner just to send him a mail, even if he was refused. A proposed solution would be to add the e-mail of the applicant to the suggested recipients of the mail thread. --- .../website_hr_recruitment/controllers/main.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/addons/website_hr_recruitment/controllers/main.py b/addons/website_hr_recruitment/controllers/main.py index 1db4eb2f02f..4bef1dfe0d8 100644 --- a/addons/website_hr_recruitment/controllers/main.py +++ b/addons/website_hr_recruitment/controllers/main.py @@ -116,22 +116,6 @@ class website_hr_recruitment(http.Controller): # Retro-compatibility for saas-3. "phone" field should be replace by "partner_phone" in the template in trunk. value['partner_phone'] = post.pop('phone', False) - # If the email is already known in our database, match it to the existing partner, else create a new one - Partner = env['res.partner'] - existing_partner = Partner.name_search(name=post.get('email_from').strip(), args=[('is_company', '=', False)], limit=1) - - if not existing_partner: - value_partner = { - 'name': post['partner_name'], - 'email': post['email_from'], - 'phone': value['partner_phone'], - } - partner = Partner.create(value_partner) - value['partner_id'] = partner.id - else: - value['partner_id'] = existing_partner[0][0] - - # Create applicant applicant = env['hr.applicant'].create(value) if post['ufile']: name = applicant.partner_name if applicant.partner_name else applicant.name