diff options
| author | Dhaval Panchal <dpa@odoo.com> | 2015-10-13 15:08:29 +0530 |
|---|---|---|
| committer | fwi-odoo <fwi@odoo.com> | 2016-11-02 11:11:27 +0100 |
| commit | c8d0fd4a50893535c7be0fb416e1f05a917e98d0 (patch) | |
| tree | 239d7e618f8919662df5e842bf921098a6f89f01 /addons/website_forum/controllers/main.py | |
| parent | 4a5d060123ddb4ea4526a572133e34c1a02df242 (diff) | |
[IMP] website_forum: Change profile picture for forum users.
Diffstat (limited to 'addons/website_forum/controllers/main.py')
| -rw-r--r-- | addons/website_forum/controllers/main.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website_forum/controllers/main.py b/addons/website_forum/controllers/main.py index 2294daf73de..ca536bc28bd 100644 --- a/addons/website_forum/controllers/main.py +++ b/addons/website_forum/controllers/main.py @@ -705,6 +705,13 @@ class WebsiteForum(http.Controller): 'country_id': int(kwargs.get('country')) if kwargs.get('country') else False, 'website_description': kwargs.get('description'), } + + if 'clear_image' in kwargs: + values['image'] = False + elif kwargs.get('ufile'): + image = kwargs.get('ufile').read() + values['image'] = image.encode('base64') + if request.uid == user.id: # the controller allows to edit only its own privacy settings; use partner management for other cases values['website_published'] = kwargs.get('website_published') == 'True' user.write(values) |
