Browse Source
Merge pull request #29 from Tecnativa/10.0-privacy_consent-avoid_race_sending_emails
[FIX] privacy_consent: Avoid race condition when sending emails
pull/30/head
Pedro M. Baeza
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
0 deletions
-
privacy_consent/models/privacy_activity.py
|
|
@ -131,6 +131,9 @@ class PrivacyActivity(models.Model): |
|
|
|
"accepted": one.default_consent, |
|
|
|
"activity_id": one.id, |
|
|
|
}) |
|
|
|
# Avoid race condition where a user could click on accept/reject link |
|
|
|
# in his email before its consent record is saved to the database |
|
|
|
consents.env.cr.commit() |
|
|
|
# Send consent request emails for automatic activitys |
|
|
|
consents.action_auto_ask() |
|
|
|
# Redirect user to new consent requests generated |
|
|
|