Skip to content

Commit

Permalink
fixup! [IMP] webservice: allow web application flow
Browse files Browse the repository at this point in the history
  • Loading branch information
gurneyalex committed May 31, 2024
1 parent 918b954 commit 3764f21
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webservice/models/webservice_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class WebserviceBackend(models.Model):
],
readonly=False,
store=True,
compute="_compute_oauth2_flow",
)
oauth2_clientid = fields.Char(string="Client ID", auth_type="oauth2")
oauth2_client_secret = fields.Char(string="Client Secret", auth_type="oauth2")
Expand Down Expand Up @@ -122,8 +121,10 @@ def _get_adapter_protocol(self):
protocol += f"+{self.auth_type}-{self.oauth2_flow}"
return protocol

@api.depends("auth_type")
def _compute_oauth2_flow(self):
@api.onchange("auth_type")
def _onchange_oauth2_auth_type(self):
# reset the auth2_flow when auth_type is not oaut2
# using a compute method interfers with the server environment mixin
for rec in self:
if rec.auth_type != "oauth2":
rec.oauth2_flow = False
Expand Down

0 comments on commit 3764f21

Please sign in to comment.