mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +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
538d224338
@ -175,7 +175,7 @@ class BuildError(models.Model):
|
|||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'active' in vals:
|
if 'active' in vals:
|
||||||
for build_error in self:
|
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:
|
if build_error.test_tags:
|
||||||
raise UserError("This error as a test-tag and can only be (de)activated by admin")
|
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():
|
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
|
raise
|
||||||
|
|
||||||
def action_check_token(self):
|
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')
|
raise UserError('This action is restricted to admin users')
|
||||||
token_results = {}
|
token_results = {}
|
||||||
for repo in self:
|
for repo in self:
|
||||||
|
Loading…
Reference in New Issue
Block a user