mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[FIX] runbot: remove user_has_groups calls
The method was removed in odoo/odoo#151597
This commit is contained in:
parent
33bef243d2
commit
eacd2f369d
@ -175,7 +175,7 @@ class BuildError(models.Model):
|
||||
def write(self, vals):
|
||||
if 'active' in vals:
|
||||
for build_error in self:
|
||||
if not (self.env.su or self.user_has_groups('runbot.group_runbot_admin')):
|
||||
if not (self.env.su or self.env.user.has_groups('runbot.group_runbot_admin')):
|
||||
if build_error.test_tags:
|
||||
raise UserError("This error as a test-tag and can only be (de)activated by admin")
|
||||
if not vals['active'] and build_error.active and build_error.last_seen_date and build_error.last_seen_date + relativedelta(days=1) > fields.Datetime.now():
|
||||
|
@ -308,7 +308,7 @@ class Remote(models.Model):
|
||||
raise
|
||||
|
||||
def action_check_token(self):
|
||||
if not self.user_has_groups('runbot.group_runbot_admin'):
|
||||
if not self.env.user.has_group('runbot.group_runbot_admin'):
|
||||
raise UserError('This action is restricted to admin users')
|
||||
token_results = {}
|
||||
for repo in self:
|
||||
|
Loading…
Reference in New Issue
Block a user