Skip to content

Commit

Permalink
[FIX] argocd.application.get_value
Browse files Browse the repository at this point in the history
  • Loading branch information
tarteo committed Nov 28, 2024
1 parent 9f26dbd commit 663c35f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions argocd_deployer/models/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import jinja2
from git import Repo

from odoo import _, api, fields, models
from odoo import Command, _, api, fields, models
from odoo.exceptions import ValidationError
from odoo.tools.safe_eval import safe_eval

Expand Down Expand Up @@ -61,7 +61,10 @@ class Application(models.Model):
def get_value(self, key, default=""):
self.ensure_one()
kv_pair = self.value_ids.filtered(lambda v: v.key == key)
return kv_pair and kv_pair.value or default
if kv_pair:
return kv_pair.value
self.value_ids = [Command.create({"key": key, "value": default})]
return default

def has_tag(self, key):
self.ensure_one()
Expand Down

0 comments on commit 663c35f

Please sign in to comment.