Skip to content

Commit

Permalink
[FIX] website: check that website.user_id is not falsy
Browse files Browse the repository at this point in the history
This field should be required.

This commits closes odoo#21997

@KangOl: diff in addons/website/models/ir_http.py is for existing db
It can be ignored in master because required will be apply
  • Loading branch information
PCatinean authored and JKE-be committed Jan 10, 2018
1 parent eeea6e8 commit eded3cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addons/website/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _get_converters(self):
def _auth_method_public(self):
if not request.session.uid:
website = self.pool['website'].get_current_website(request.cr, openerp.SUPERUSER_ID, context=request.context)
if website:
if website and website.user_id:
request.uid = website.user_id.id
else:
request.uid = self.pool['ir.model.data'].xmlid_to_res_id(request.cr, openerp.SUPERUSER_ID, 'base', 'public_user')
Expand Down
2 changes: 1 addition & 1 deletion addons/website/models/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _get_menu(self, cr, uid, ids, name, arg, context=None):
'social_youtube': fields.char('Youtube Account'),
'social_googleplus': fields.char('Google+ Account'),
'google_analytics_key': fields.char('Google Analytics Key'),
'user_id': fields.many2one('res.users', string='Public User'),
'user_id': fields.many2one('res.users', string='Public User', required=True),
'compress_html': fields.boolean('Compress HTML'),
'cdn_activated': fields.boolean('Activate CDN for assets'),
'cdn_url': fields.char('CDN Base URL'),
Expand Down

0 comments on commit eded3cf

Please sign in to comment.